Wine-Devel
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 4 participants
- 84544 discussions
[PATCH 4/5] riched20: Use paragraph ptrs in the table move from row start function.
by Huw Davies Oct. 29, 2020
by Huw Davies Oct. 29, 2020
Oct. 29, 2020
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 2 +-
dlls/riched20/editor.h | 2 +-
dlls/riched20/table.c | 15 ++++++++-------
dlls/riched20/undo.c | 4 ++--
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 7687ec9d93e..797eb27b6b9 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2690,7 +2690,7 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey)
}
else
return TRUE;
- ME_MoveCursorFromTableRowStartParagraph(editor);
+ table_move_from_row_start( editor );
ME_UpdateSelectionLinkAttribute(editor);
ME_UpdateRepaint(editor, FALSE);
ME_SendRequestResize(editor, FALSE);
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index a49883c9861..b8916bc4ff3 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -302,6 +302,7 @@ ME_Paragraph *table_insert_cell( ME_TextEditor *editor, ME_Cursor *cursor ) DECL
ME_Paragraph *table_insert_row_end( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start_at_para( ME_TextEditor *editor, ME_Paragraph *para ) DECLSPEC_HIDDEN;
+void table_move_from_row_start( ME_TextEditor *editor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_outer_para( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void table_protect_partial_deletion( ME_TextEditor *editor, ME_Cursor *c, int *num_chars ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_end( ME_Paragraph *para ) DECLSPEC_HIDDEN;
@@ -309,7 +310,6 @@ ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
-void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c
index 25c4e1820ce..c262d190b79 100644
--- a/dlls/riched20/table.c
+++ b/dlls/riched20/table.c
@@ -629,16 +629,17 @@ void table_handle_tab( ME_TextEditor *editor, BOOL selected_row )
/* Make sure the cursor is not in the hidden table row start paragraph
* without a selection. */
-void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor)
+void table_move_from_row_start( ME_TextEditor *editor )
{
- ME_DisplayItem *para = editor->pCursors[0].pPara;
- if (para == editor->pCursors[1].pPara &&
- para->member.para.nFlags & MEPF_ROWSTART) {
+ ME_Paragraph *para = &editor->pCursors[0].pPara->member.para;
+
+ if (para == &editor->pCursors[1].pPara->member.para && para->nFlags & MEPF_ROWSTART)
+ {
/* The cursors should not be at the hidden start row paragraph without
* a selection, so the cursor is moved into the first cell. */
- para = para->member.para.next_para;
- editor->pCursors[0].pPara = para;
- editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun);
+ para = para_next( para );
+ editor->pCursors[0].pPara = para_get_di( para );
+ editor->pCursors[0].pRun = run_get_di( para_first_run( para ) );
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
}
diff --git a/dlls/riched20/undo.c b/dlls/riched20/undo.c
index d9c5d28d6dc..fe0a4f721cd 100644
--- a/dlls/riched20/undo.c
+++ b/dlls/riched20/undo.c
@@ -438,7 +438,7 @@ BOOL ME_Undo(ME_TextEditor *editor)
destroy_undo_item( undo );
}
- ME_MoveCursorFromTableRowStartParagraph(editor);
+ table_move_from_row_start( editor );
add_undo( editor, undo_end_transaction );
ME_CheckTablesForCorruption(editor);
editor->nUndoStackSize--;
@@ -475,7 +475,7 @@ BOOL ME_Redo(ME_TextEditor *editor)
list_remove( &undo->entry );
destroy_undo_item( undo );
}
- ME_MoveCursorFromTableRowStartParagraph(editor);
+ table_move_from_row_start( editor );
add_undo( editor, undo_end_transaction );
ME_CheckTablesForCorruption(editor);
editor->nUndoMode = nMode;
--
2.23.0
1
0
Oct. 29, 2020
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 6 +--
dlls/riched20/editor.h | 2 +-
dlls/riched20/table.c | 104 +++++++++++++++++++----------------------
3 files changed, 52 insertions(+), 60 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index d06693232ab..7687ec9d93e 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -2799,7 +2799,7 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
!(ctrl_is_down && !editor->bEmulateVersion10))
{
ME_DisplayItem *para;
- BOOL bSelectedRow = FALSE;
+ BOOL selected_row = FALSE;
para = cursor.pPara;
if (ME_IsSelection(editor) &&
@@ -2808,11 +2808,11 @@ static LRESULT ME_Char(ME_TextEditor *editor, WPARAM charCode,
para->member.para.prev_para->type == diParagraph)
{
para = para->member.para.prev_para;
- bSelectedRow = TRUE;
+ selected_row = TRUE;
}
if (ME_IsInTable(para))
{
- ME_TabPressedInTable(editor, bSelectedRow);
+ table_handle_tab( editor, selected_row );
ME_CommitUndo(editor);
return 0;
}
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index 6e1c639236e..a49883c9861 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -297,6 +297,7 @@ ME_Paragraph *cell_first_para( ME_Cell *cell ) DECLSPEC_HIDDEN;
ME_Cell *cell_next( ME_Cell *cell ) DECLSPEC_HIDDEN;
ME_Cell *cell_prev( ME_Cell *cell ) DECLSPEC_HIDDEN;
ME_Paragraph *table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row ) DECLSPEC_HIDDEN;
+void table_handle_tab( ME_TextEditor *editor, BOOL selected_row ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_cell( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_end( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
@@ -308,7 +309,6 @@ ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
-void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow) DECLSPEC_HIDDEN;
void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c
index cc2ebb8ed50..25c4e1820ce 100644
--- a/dlls/riched20/table.c
+++ b/dlls/riched20/table.c
@@ -481,30 +481,27 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
}
/* Selects the next table cell or appends a new table row if at end of table */
-static void ME_SelectOrInsertNextCell( ME_TextEditor *editor, ME_DisplayItem *run )
+static void table_select_next_cell_or_append( ME_TextEditor *editor, ME_Run *run )
{
- ME_Paragraph *para = run->member.run.para;
+ ME_Paragraph *para = run->para;
+ ME_Cell *cell;
int i;
- assert(run && run->type == diRun);
- assert(ME_IsInTable(run));
+ assert( para_in_table( para ) );
if (!editor->bEmulateVersion10) /* v4.1 */
{
- ME_DisplayItem *cell;
/* Get the initial cell */
- if (para->nFlags & MEPF_ROWSTART) cell = para_next( para )->pCell;
- else if (para->nFlags & MEPF_ROWEND) cell = para_prev( para )->pCell;
- else cell = para->pCell;
- assert(cell);
+ if (para->nFlags & MEPF_ROWSTART) cell = para_cell( para_next( para ) );
+ else if (para->nFlags & MEPF_ROWEND) cell = para_cell( para_prev( para ) );
+ else cell = para_cell( para );
/* Get the next cell. */
- if (cell->member.cell.next_cell &&
- cell->member.cell.next_cell->member.cell.next_cell)
+ if (cell_next( cell ) && cell_next( cell_next( cell ) ))
+ cell = cell_next( cell );
+ else
{
- cell = cell->member.cell.next_cell;
- } else {
- para = para_next( table_row_end( &ME_FindItemFwd( cell, diParagraph )->member.para ) );
- if (para->nFlags & MEPF_ROWSTART) cell = para_next( para )->pCell;
+ para = para_next( table_row_end( para ) );
+ if (para->nFlags & MEPF_ROWSTART) cell = para_cell( para_next( para ) );
else
{
/* Insert row */
@@ -521,38 +518,32 @@ static void ME_SelectOrInsertNextCell( ME_TextEditor *editor, ME_DisplayItem *ru
}
}
/* Select cell */
- editor->pCursors[1].pRun = ME_FindItemFwd(cell, diRun);
- editor->pCursors[1].pPara = ME_GetParagraph(editor->pCursors[1].pRun);
+ editor->pCursors[1].pPara = para_get_di( cell_first_para( cell ) );
+ editor->pCursors[1].pRun = run_get_di( para_first_run( &editor->pCursors[1].pPara->member.para ) );
editor->pCursors[1].nOffset = 0;
- assert(editor->pCursors[0].pRun);
- cell = cell->member.cell.next_cell;
- editor->pCursors[0].pRun = ME_FindItemBack(cell, diRun);
- editor->pCursors[0].pPara = ME_GetParagraph(editor->pCursors[0].pRun);
+ editor->pCursors[0].pPara = para_get_di( cell_end_para( cell ) );
+ editor->pCursors[0].pRun = run_get_di( para_end_run( &editor->pCursors[0].pPara->member.para ) );
editor->pCursors[0].nOffset = 0;
- assert(editor->pCursors[1].pRun);
}
else /* v1.0 - 3.0 */
{
- if (run->member.run.nFlags & MERF_ENDPARA &&
- ME_IsInTable(ME_FindItemFwd(run, diParagraphOrEnd)))
+ if (run->nFlags & MERF_ENDPARA && para_in_table( para_next( para ) ))
{
- run = ME_FindItemFwd(run, diRun);
+ run = run_next_all_paras( run );
assert(run);
}
for (i = 0; i < 2; i++)
{
- while (!(run->member.run.nFlags & MERF_TAB))
+ while (!(run->nFlags & MERF_TAB))
{
- run = ME_FindItemFwd(run, diRunOrParagraphOrEnd);
- if (run->type != diRun)
+ if (!run_next( run ))
{
- para = &run->member.para;
+ para = para_next( run->para );
if (para_in_table( para ))
{
- run = run_get_di( para_first_run( para ) );
- assert(run);
+ run = para_first_run( para );
editor->pCursors[0].pPara = para_get_di( para );
- editor->pCursors[0].pRun = run;
+ editor->pCursors[0].pRun = run_get_di( run );
editor->pCursors[0].nOffset = 0;
i = 1;
}
@@ -569,18 +560,18 @@ static void ME_SelectOrInsertNextCell( ME_TextEditor *editor, ME_DisplayItem *ru
return;
}
}
+ else run = run_next( run );
}
- if (i == 0)
- run = ME_FindItemFwd(run, diRun);
- editor->pCursors[i].pRun = run;
- editor->pCursors[i].pPara = ME_GetParagraph(run);
+ if (i == 0) run = run_next_all_paras( run );
+ editor->pCursors[i].pRun = run_get_di( run );
+ editor->pCursors[i].pPara = para_get_di( run->para );
editor->pCursors[i].nOffset = 0;
}
}
}
-void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow)
+void table_handle_tab( ME_TextEditor *editor, BOOL selected_row )
{
/* FIXME: Shift tab should move to the previous cell. */
ME_Cursor fromCursor, toCursor;
@@ -593,7 +584,9 @@ void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow)
{
fromCursor = editor->pCursors[0];
toCursor = editor->pCursors[1];
- } else {
+ }
+ else
+ {
fromCursor = editor->pCursors[1];
toCursor = editor->pCursors[0];
}
@@ -604,29 +597,28 @@ void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow)
{
editor->pCursors[0] = toCursor;
editor->pCursors[1] = toCursor;
- } else {
- ME_SelectOrInsertNextCell(editor, toCursor.pRun);
}
- } else { /* v1.0 - 3.0 */
- if (!ME_IsInTable(fromCursor.pRun)) {
+ else table_select_next_cell_or_append( editor, &toCursor.pRun->member.run );
+ }
+ else /* v1.0 - 3.0 */
+ {
+ if (!ME_IsInTable(fromCursor.pRun))
+ {
editor->pCursors[0] = fromCursor;
editor->pCursors[1] = fromCursor;
/* FIXME: For some reason the caret is shown at the start of the
* previous paragraph in v1.0 to v3.0 */
- } else if ((bSelectedRow || !ME_IsInTable(toCursor.pRun))) {
- ME_SelectOrInsertNextCell(editor, fromCursor.pRun);
- } else {
- if (ME_IsSelection(editor) && !toCursor.nOffset)
- {
- ME_DisplayItem *run;
- run = ME_FindItemBack(toCursor.pRun, diRunOrParagraphOrEnd);
- if (run->type == diRun && run->member.run.nFlags & MERF_TAB)
- ME_SelectOrInsertNextCell(editor, run);
- else
- ME_SelectOrInsertNextCell(editor, toCursor.pRun);
- } else {
- ME_SelectOrInsertNextCell(editor, toCursor.pRun);
- }
+ }
+ else if ((selected_row || !para_in_table( &toCursor.pPara->member.para )))
+ table_select_next_cell_or_append( editor, &fromCursor.pRun->member.run );
+ else
+ {
+ ME_Run *run = run_prev( &toCursor.pRun->member.run );
+
+ if (ME_IsSelection(editor) && !toCursor.nOffset && run && run->nFlags & MERF_TAB)
+ table_select_next_cell_or_append( editor, run );
+ else
+ table_select_next_cell_or_append( editor, &toCursor.pRun->member.run );
}
}
ME_InvalidateSelection(editor);
--
2.23.0
1
0
Oct. 29, 2020
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/table.c | 35 ++++++++++++++++-------------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c
index 40eef4bbd13..cc2ebb8ed50 100644
--- a/dlls/riched20/table.c
+++ b/dlls/riched20/table.c
@@ -429,16 +429,14 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
{
WCHAR endl = '\r', tab = '\t';
ME_Run *run;
- PARAFORMAT2 *pFmt;
int i;
- assert(table_row);
if (!editor->bEmulateVersion10) /* v4.1 */
{
- ME_DisplayItem *insertedCell, *cell;
- ME_Paragraph *para, *prev_table_end;
+ ME_Cell *new_cell, *cell;
+ ME_Paragraph *para, *prev_table_end, *new_row_start;
- cell = ME_FindItemFwd( para_get_di( table_row_start( table_row ) ), diCell );
+ cell = table_row_first_cell( table_row );
prev_table_end = table_row_end( table_row );
para = para_next( prev_table_end );
run = para_first_run( para );
@@ -446,38 +444,37 @@ ME_Paragraph* table_append_row( ME_TextEditor *editor, ME_Paragraph *table_row )
editor->pCursors[0].pRun = run_get_di( run );
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
- para = table_insert_row_start( editor, editor->pCursors );
- insertedCell = ME_FindItemFwd( para_get_di( para ), diCell );
+ new_row_start = table_insert_row_start( editor, editor->pCursors );
+ new_cell = table_row_first_cell( new_row_start );
/* Copy cell properties */
- insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary;
- insertedCell->member.cell.border = cell->member.cell.border;
- while (cell->member.cell.next_cell)
+ new_cell->nRightBoundary = cell->nRightBoundary;
+ new_cell->border = cell->border;
+ while (cell_next( cell ))
{
- cell = cell->member.cell.next_cell;
+ cell = cell_next( cell );
para = table_insert_cell( editor, editor->pCursors );
- insertedCell = ME_FindItemBack( para_get_di( para ), diCell );
+ new_cell = para_cell( para );
/* Copy cell properties */
- insertedCell->member.cell.nRightBoundary = cell->member.cell.nRightBoundary;
- insertedCell->member.cell.border = cell->member.cell.border;
+ new_cell->nRightBoundary = cell->nRightBoundary;
+ new_cell->border = cell->border;
};
para = table_insert_row_end( editor, editor->pCursors );
para->fmt = prev_table_end->fmt;
/* return the table row start for the inserted paragraph */
- return para_next( &ME_FindItemFwd( cell, diParagraph )->member.para );
+ return new_row_start;
}
else /* v1.0 - 3.0 */
{
run = para_end_run( table_row );
- pFmt = &table_row->fmt;
- assert(pFmt->dwMask & PFM_TABLE && pFmt->wEffects & PFE_TABLE);
+ assert( para_in_table( table_row ) );
editor->pCursors[0].pPara = para_get_di( table_row );
editor->pCursors[0].pRun = run_get_di( run );
editor->pCursors[0].nOffset = 0;
editor->pCursors[1] = editor->pCursors[0];
ME_InsertTextFromCursor( editor, 0, &endl, 1, run->style );
run = &editor->pCursors[0].pRun->member.run;
- for (i = 0; i < pFmt->cTabCount; i++)
- ME_InsertTextFromCursor(editor, 0, &tab, 1, run->style);
+ for (i = 0; i < table_row->fmt.cTabCount; i++)
+ ME_InsertTextFromCursor( editor, 0, &tab, 1, run->style );
return para_next( table_row );
}
--
2.23.0
1
0
[PATCH 1/5] riched20: Use para and run ptrs in the table deletion function.
by Huw Davies Oct. 29, 2020
by Huw Davies Oct. 29, 2020
Oct. 29, 2020
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/caret.c | 7 +--
dlls/riched20/editor.h | 2 +-
dlls/riched20/table.c | 136 +++++++++++++++++++----------------------
3 files changed, 67 insertions(+), 78 deletions(-)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 8af0f1de724..68bf40c76de 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -306,12 +306,11 @@ BOOL ME_InternalDeleteText(ME_TextEditor *editor, ME_Cursor *start,
if (!bForce)
{
- ME_ProtectPartialTableDeletion(editor, &c, &nChars);
- if (nChars == 0)
- return FALSE;
+ table_protect_partial_deletion( editor, &c, &nChars );
+ if (nChars == 0) return FALSE;
}
- while(nChars > 0)
+ while (nChars > 0)
{
ME_Run *run;
cursor_from_char_ofs( editor, nOfs + nChars, &c );
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index ddb6d138957..6e1c639236e 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -302,12 +302,12 @@ ME_Paragraph *table_insert_row_end( ME_TextEditor *editor, ME_Cursor *cursor ) D
ME_Paragraph *table_insert_row_start( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
ME_Paragraph *table_insert_row_start_at_para( ME_TextEditor *editor, ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Paragraph *table_outer_para( ME_Paragraph *para ) DECLSPEC_HIDDEN;
+void table_protect_partial_deletion( ME_TextEditor *editor, ME_Cursor *c, int *num_chars ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_end( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Cell *table_row_end_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
void ME_CheckTablesForCorruption(ME_TextEditor *editor) DECLSPEC_HIDDEN;
-void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, ME_Cursor *c, int *nChars) DECLSPEC_HIDDEN;
void ME_TabPressedInTable(ME_TextEditor *editor, BOOL bSelectedRow) DECLSPEC_HIDDEN;
void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor) DECLSPEC_HIDDEN;
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c
index 33e89a11771..40eef4bbd13 100644
--- a/dlls/riched20/table.c
+++ b/dlls/riched20/table.c
@@ -315,123 +315,113 @@ BOOL ME_IsInTable(ME_DisplayItem *pItem)
}
/* Table rows should either be deleted completely or not at all. */
-void ME_ProtectPartialTableDeletion(ME_TextEditor *editor, ME_Cursor *c, int *nChars)
+void table_protect_partial_deletion( ME_TextEditor *editor, ME_Cursor *c, int *num_chars )
{
- int nOfs = ME_GetCursorOfs(c);
+ int start_ofs = ME_GetCursorOfs( c );
ME_Cursor c2 = *c;
- ME_DisplayItem *this_para = c->pPara;
- ME_DisplayItem *end_para;
+ ME_Paragraph *this_para = &c->pPara->member.para, *end_para;
- ME_MoveCursorChars(editor, &c2, *nChars, FALSE);
- end_para = c2.pPara;
- if (c2.pRun->member.run.nFlags & MERF_ENDPARA) {
+ ME_MoveCursorChars( editor, &c2, *num_chars, FALSE );
+ end_para = &c2.pPara->member.para;
+ if (c2.pRun->member.run.nFlags & MERF_ENDPARA)
+ {
/* End offset might be in the middle of the end paragraph run.
* If this is the case, then we need to use the next paragraph as the last
* paragraphs.
*/
- int remaining = nOfs + *nChars - c2.pRun->member.run.nCharOfs
- - end_para->member.para.nCharOfs;
+ int remaining = start_ofs + *num_chars - c2.pRun->member.run.nCharOfs - end_para->nCharOfs;
if (remaining)
{
- assert(remaining < c2.pRun->member.run.len);
- end_para = end_para->member.para.next_para;
+ assert( remaining < c2.pRun->member.run.len );
+ end_para = para_next( end_para );
}
}
- if (!editor->bEmulateVersion10) { /* v4.1 */
- if (this_para->member.para.pCell != end_para->member.para.pCell ||
- ((this_para->member.para.nFlags|end_para->member.para.nFlags)
- & (MEPF_ROWSTART|MEPF_ROWEND)))
+ if (!editor->bEmulateVersion10) /* v4.1 */
+ {
+ if (para_cell( this_para ) != para_cell( end_para ) ||
+ ((this_para->nFlags | end_para->nFlags) & (MEPF_ROWSTART | MEPF_ROWEND)))
{
while (this_para != end_para)
{
- ME_DisplayItem *next_para = this_para->member.para.next_para;
- BOOL bTruancateDeletion = FALSE;
- if (this_para->member.para.nFlags & MEPF_ROWSTART) {
+ ME_Paragraph *next_para = para_next( this_para );
+ BOOL truancate_del = FALSE;
+ if (this_para->nFlags & MEPF_ROWSTART)
+ {
/* The following while loop assumes that next_para is MEPF_ROWSTART,
- * so moving back one paragraph let's it be processed as the start
+ * so moving back one paragraph lets it be processed as the start
* of the row. */
next_para = this_para;
- this_para = this_para->member.para.prev_para;
- } else if (next_para->member.para.pCell != this_para->member.para.pCell
- || this_para->member.para.nFlags & MEPF_ROWEND)
+ this_para = para_prev( this_para );
+ }
+ else if (para_cell( next_para) != para_cell( this_para ) || this_para->nFlags & MEPF_ROWEND)
{
/* Start of the deletion from after the start of the table row. */
- bTruancateDeletion = TRUE;
+ truancate_del = TRUE;
}
- while (!bTruancateDeletion &&
- next_para->member.para.nFlags & MEPF_ROWSTART)
+ while (!truancate_del && next_para->nFlags & MEPF_ROWSTART)
{
- next_para = table_row_end( &next_para->member.para )->next_para;
- if (next_para->member.para.nCharOfs > nOfs + *nChars)
+ next_para = para_next( table_row_end( next_para ) );
+ if (next_para->nCharOfs > start_ofs + *num_chars)
{
/* End of deletion is not past the end of the table row. */
- next_para = this_para->member.para.next_para;
+ next_para = para_next( this_para );
/* Delete the end paragraph preceding the table row if the
* preceding table row will be empty. */
- if (this_para->member.para.nCharOfs >= nOfs)
- {
- next_para = next_para->member.para.next_para;
- }
- bTruancateDeletion = TRUE;
- } else {
- this_para = next_para->member.para.prev_para;
+ if (this_para->nCharOfs >= start_ofs) next_para = para_next( next_para );
+ truancate_del = TRUE;
}
+ else this_para = para_prev( next_para );
}
- if (bTruancateDeletion)
+ if (truancate_del)
{
- ME_Run *end_run = &ME_FindItemBack(next_para, diRun)->member.run;
- int nCharsNew = (next_para->member.para.nCharOfs - nOfs
- - end_run->len);
- nCharsNew = max(nCharsNew, 0);
- assert(nCharsNew <= *nChars);
- *nChars = nCharsNew;
+ ME_Run *end_run = para_end_run( para_prev( next_para ) );
+ int new_chars = next_para->nCharOfs - start_ofs - end_run->len;
+ new_chars = max( new_chars, 0 );
+ assert( new_chars <= *num_chars);
+ *num_chars = new_chars;
break;
}
this_para = next_para;
}
}
- } else { /* v1.0 - 3.0 */
- ME_DisplayItem *pRun;
- int nCharsToBoundary;
+ }
+ else /* v1.0 - 3.0 */
+ {
+ ME_Run *run;
+ int chars_to_boundary;
- if ((this_para->member.para.nCharOfs != nOfs || this_para == end_para) &&
- this_para->member.para.fmt.dwMask & PFM_TABLE &&
- this_para->member.para.fmt.wEffects & PFE_TABLE)
+ if ((this_para->nCharOfs != start_ofs || this_para == end_para) && para_in_table( this_para ))
{
- pRun = c->pRun;
+ run = &c->pRun->member.run;
/* Find the next tab or end paragraph to use as a delete boundary */
- while (!(pRun->member.run.nFlags & (MERF_TAB|MERF_ENDPARA)))
- pRun = ME_FindItemFwd(pRun, diRun);
- nCharsToBoundary = pRun->member.run.nCharOfs
- - c->pRun->member.run.nCharOfs
- - c->nOffset;
- *nChars = min(*nChars, nCharsToBoundary);
- } else if (end_para->member.para.fmt.dwMask & PFM_TABLE &&
- end_para->member.para.fmt.wEffects & PFE_TABLE)
+ while (!(run->nFlags & (MERF_TAB | MERF_ENDPARA)))
+ run = run_next( run );
+ chars_to_boundary = run->nCharOfs - c->pRun->member.run.nCharOfs - c->nOffset;
+ *num_chars = min( *num_chars, chars_to_boundary );
+ }
+ else if (para_in_table( end_para ))
{
/* The deletion starts from before the row, so don't join it with
* previous non-empty paragraphs. */
- ME_DisplayItem *curPara;
- pRun = NULL;
- if (nOfs > this_para->member.para.nCharOfs) {
- pRun = ME_FindItemBack(end_para, diRun);
- curPara = end_para->member.para.prev_para;
+ ME_Paragraph *cur_para;
+ run = NULL;
+ if (start_ofs > this_para->nCharOfs)
+ {
+ cur_para = para_prev( end_para );
+ run = para_end_run( cur_para );
}
- if (!pRun) {
- pRun = ME_FindItemFwd(end_para, diRun);
- curPara = end_para;
+ if (!run)
+ {
+ cur_para = end_para;
+ run = para_first_run( end_para );
}
- if (pRun)
+ if (run)
{
- nCharsToBoundary = curPara->member.para.nCharOfs
- + pRun->member.run.nCharOfs
- - nOfs;
- if (nCharsToBoundary >= 0)
- *nChars = min(*nChars, nCharsToBoundary);
+ chars_to_boundary = cur_para->nCharOfs + run->nCharOfs - start_ofs;
+ if (chars_to_boundary >= 0) *num_chars = min( *num_chars, chars_to_boundary );
}
}
- if (*nChars < 0)
- *nChars = 0;
+ if (*num_chars < 0) *num_chars = 0;
}
}
--
2.23.0
1
0
Oct. 29, 2020
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/tests/automation.c | 273 +++++++++++++++---------------------
dlls/msi/tests/custom.c | 81 +++++------
dlls/msi/tests/db.c | 75 +++-------
dlls/msi/tests/install.c | 27 ++--
dlls/msi/tests/msi.c | 30 ++--
dlls/msi/tests/package.c | 124 +++++++---------
dlls/msi/tests/patch.c | 15 +-
dlls/msi/tests/record.c | 7 +-
dlls/msi/tests/suminfo.c | 3 +-
9 files changed, 250 insertions(+), 385 deletions(-)
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index 7e5124c1a16..42c41dcd731 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -41,14 +41,6 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
static const char *msifile = "winetest-automation.msi";
-static const WCHAR szMsifile[] = {'w','i','n','e','t','e','s','t','-','a','u','t','o','m','a','t','i','o','n','.','m','s','i',0};
-static const WCHAR szMSITEST[] = { 'M','S','I','T','E','S','T',0 };
-static const WCHAR szProductCode[] = { '{','8','3','7','4','5','0','f','a','-','a','3','9','b','-','4','b','c','8','-','b','3','2','1','-','0','8','b','3','9','3','f','7','8','4','b','3','}',0 };
-static const WCHAR szUpgradeCode[] = { '{','C','E','0','6','7','E','8','D','-','2','E','1','A','-','4','3','6','7','-','B','7','3','4','-','4','E','B','2','B','D','A','D','6','5','6','5','}',0 };
-static const WCHAR szProductInfoException[] = { 'P','r','o','d','u','c','t','I','n','f','o',',','P','r','o','d','u','c','t',',','A','t','t','r','i','b','u','t','e',0 };
-static const WCHAR WINE_INSTALLPROPERTY_PACKAGENAMEW[] = {'P','a','c','k','a','g','e','N','a','m','e',0};
-static const WCHAR WINE_INSTALLPROPERTY_PRODUCTNAMEW[] = {'P','r','o','d','u','c','t','N','a','m','e',0};
-static const WCHAR WINE_INSTALLPROPERTY_LOCALPACKAGEW[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
static FILETIME systemtime;
static CHAR CURR_DIR[MAX_PATH];
static EXCEPINFO excepinfo;
@@ -56,7 +48,6 @@ static EXCEPINFO excepinfo;
/*
* OLE automation data
**/
-static const WCHAR szProgId[] = { 'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r','.','I','n','s','t','a','l','l','e','r',0 };
static IDispatch *pInstaller;
/* msi database data */
@@ -345,7 +336,6 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
static BOOL create_package(LPWSTR path)
{
- static const WCHAR slashW[] = {'\\',0};
DWORD len;
/* Prepare package */
@@ -357,8 +347,7 @@ static BOOL create_package(LPWSTR path)
if (!len)
return FALSE;
- lstrcatW(path, slashW);
- lstrcatW(path, szMsifile);
+ lstrcatW(path, L"\\winetest-automation.msi");
return TRUE;
}
@@ -486,8 +475,6 @@ static CHAR string1[MAX_PATH], string2[MAX_PATH];
ok(0, format, extra, string1, aString); \
/* exception checker */
-static const WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0};
-
#define ok_exception(hr, szDescription) \
if (hr == DISP_E_EXCEPTION) \
{ \
@@ -496,7 +483,7 @@ static const WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o'
\
ok(excepinfo.bstrSource != NULL, "Exception source was NULL\n"); \
if (excepinfo.bstrSource) \
- ok_w2("Exception source was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrSource, szSource); \
+ ok_w2("Exception source was \"%s\" but expected to be \"%s\"\n", excepinfo.bstrSource, L"Msi API Error"); \
\
ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \
if (excepinfo.bstrDescription) \
@@ -625,9 +612,6 @@ static void test_dispid(void)
/* Test basic IDispatch functions */
static void test_dispatch(void)
{
- static WCHAR szOpenPackage[] = { 'O','p','e','n','P','a','c','k','a','g','e',0 };
- static const WCHAR szOpenPackageException[] = {'O','p','e','n','P','a','c','k','a','g','e',',','P','a','c','k','a','g','e','P','a','t','h',',','O','p','t','i','o','n','s',0};
- static WCHAR szProductState[] = { 'P','r','o','d','u','c','t','S','t','a','t','e',0 };
HRESULT hr;
DISPID dispid;
OLECHAR *name;
@@ -637,7 +621,7 @@ static void test_dispatch(void)
DISPPARAMS dispparams = {NULL, NULL, 0, 0};
/* Test getting ID of a function name that does not exist */
- name = (WCHAR *)szMsifile;
+ name = (WCHAR *)L"winetest-automation.msi";
hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
ok(hr == DISP_E_UNKNOWNNAME, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -646,7 +630,7 @@ static void test_dispatch(void)
ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Test getting ID of a function name that does exist */
- name = szOpenPackage;
+ name = (WCHAR *)L"OpenPackage";
hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -683,10 +667,10 @@ static void test_dispatch(void)
dispparams.cArgs = 1;
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
- V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
- ok_exception(hr, szOpenPackageException);
+ ok_exception(hr, L"OpenPackage,PackagePath,Options");
VariantClear(&vararg[0]);
/* Provide the required BSTR and an empty second parameter.
@@ -695,11 +679,11 @@ static void test_dispatch(void)
dispparams.cArgs = 2;
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
- V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi");
VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
- ok_exception(hr, szOpenPackageException);
+ ok_exception(hr, L"OpenPackage,PackagePath,Options");
VariantClear(&vararg[1]);
/* Provide the required BSTR and two empty parameters.
@@ -708,22 +692,22 @@ static void test_dispatch(void)
dispparams.cArgs = 3;
VariantInit(&vararg[2]);
V_VT(&vararg[2]) = VT_BSTR;
- V_BSTR(&vararg[2]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[2]) = SysAllocString(L"winetest-automation.msi");
VariantInit(&vararg[1]);
VariantInit(&vararg[0]);
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
- ok_exception(hr, szOpenPackageException);
+ ok_exception(hr, L"OpenPackage,PackagePath,Options");
VariantClear(&vararg[2]);
/* Provide the required BSTR and a second parameter with the wrong type. */
dispparams.cArgs = 2;
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
- V_BSTR(&vararg[1]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi");
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
- V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr);
VariantClear(&vararg[0]);
@@ -738,10 +722,10 @@ static void test_dispatch(void)
dispparams.cArgs = 1;
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_BSTR;
- V_BSTR(&vararg[0]) = SysAllocString(szMsifile);
+ V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi");
hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr);
- ok_exception(hr, szOpenPackageException);
+ ok_exception(hr, L"OpenPackage,PackagePath,Options");
VariantClear(&vararg[0]);
if (hr != DISP_E_EXCEPTION)
VariantClear(&varresult);
@@ -831,7 +815,7 @@ static void test_dispatch(void)
ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */
- name = szProductState;
+ name = (WCHAR *)L"ProductState";
hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid);
ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -1593,8 +1577,6 @@ static HRESULT SummaryInfo_PropertyCountGet(IDispatch *pSummaryInfo, int *pCount
static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *info, int num_info, BOOL readonly)
{
- static const WCHAR szPropertyException[] = { 'P','r','o','p','e','r','t','y',',','P','i','d',0 };
- static const WCHAR szTitle[] = { 'T','i','t','l','e',0 };
VARIANT varresult, var;
SYSTEMTIME st;
HRESULT hr;
@@ -1647,11 +1629,11 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
/* Invalid pids */
hr = SummaryInfo_PropertyGet(pSummaryInfo, -1, &varresult, VT_EMPTY);
ok(hr == DISP_E_EXCEPTION, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szPropertyException);
+ ok_exception(hr, L"Property,Pid");
hr = SummaryInfo_PropertyGet(pSummaryInfo, 1000, &varresult, VT_EMPTY);
ok(hr == DISP_E_EXCEPTION, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szPropertyException);
+ ok_exception(hr, L"Property,Pid");
/* Unsupported pids */
hr = SummaryInfo_PropertyGet(pSummaryInfo, PID_DICTIONARY, &varresult, VT_EMPTY);
@@ -1692,7 +1674,7 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
/* VT_BSTR */
V_VT(&var) = VT_BSTR;
- V_BSTR(&var) = SysAllocString(szTitle);
+ V_BSTR(&var) = SysAllocString(L"Title");
hr = SummaryInfo_PropertyPut(pSummaryInfo, PID_TITLE, &var);
ok(hr == S_OK, "SummaryInfo_PropertyPut failed, hresult 0x%08x\n", hr);
@@ -1736,15 +1718,10 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
static void test_Database(IDispatch *pDatabase, BOOL readonly)
{
- static const WCHAR szSql[] = { 'S','E','L','E','C','T',' ','`','F','e','a','t','u','r','e','`',' ','F','R','O','M',' ','`','F','e','a','t','u','r','e','`',' ','W','H','E','R','E',' ','`','F','e','a','t','u','r','e','_','P','a','r','e','n','t','`','=','\'','O','n','e','\'',0 };
- static const WCHAR szThree[] = { 'T','h','r','e','e',0 };
- static const WCHAR szTwo[] = { 'T','w','o',0 };
- static const WCHAR szStringDataField[] = { 'S','t','r','i','n','g','D','a','t','a',',','F','i','e','l','d',0 };
- static const WCHAR szModifyModeRecord[] = { 'M','o','d','i','f','y',',','M','o','d','e',',','R','e','c','o','r','d',0 };
IDispatch *pView = NULL, *pSummaryInfo = NULL;
HRESULT hr;
- hr = Database_OpenView(pDatabase, szSql, &pView);
+ hr = Database_OpenView(pDatabase, L"SELECT `Feature` FROM `Feature` WHERE `Feature_Parent`='One'", &pView);
ok(hr == S_OK, "Database_OpenView failed, hresult 0x%08x\n", hr);
if (hr == S_OK)
{
@@ -1765,35 +1742,35 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
memset(szString, 0, sizeof(szString));
hr = Record_StringDataGet(pRecord, 1, szString);
ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
- ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree);
+ ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
/* Record::StringDataPut with correct index */
- hr = Record_StringDataPut(pRecord, 1, szTwo);
+ hr = Record_StringDataPut(pRecord, 1, L"Two");
ok(hr == S_OK, "Record_StringDataPut failed, hresult 0x%08x\n", hr);
/* Record::StringDataGet */
memset(szString, 0, sizeof(szString));
hr = Record_StringDataGet(pRecord, 1, szString);
ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
- ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo);
+ ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
/* Record::StringDataPut with incorrect index */
hr = Record_StringDataPut(pRecord, -1, szString);
ok(hr == DISP_E_EXCEPTION, "Record_StringDataPut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szStringDataField);
+ ok_exception(hr, L"StringData,Field");
/* View::Modify with incorrect parameters */
hr = View_Modify(pView, -5, NULL);
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModifyModeRecord);
+ ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, -5, pRecord);
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModifyModeRecord);
+ ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL);
ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModifyModeRecord);
+ ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord);
ok(hr == S_OK, "View_Modify failed, hresult 0x%08x\n", hr);
@@ -1802,7 +1779,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
memset(szString, 0, sizeof(szString));
hr = Record_StringDataGet(pRecord, 1, szString);
ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
- todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree);
+ todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
IDispatch_Release(pRecord);
}
@@ -1817,7 +1794,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
memset(szString, 0, sizeof(szString));
hr = Record_StringDataGet(pRecord, 1, szString);
ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr);
- ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo);
+ ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
IDispatch_Release(pRecord);
}
@@ -1849,17 +1826,6 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
static void test_Session(IDispatch *pSession)
{
- static const WCHAR szProductName[] = { 'P','r','o','d','u','c','t','N','a','m','e',0 };
- static const WCHAR szOne[] = { 'O','n','e',0 };
- static const WCHAR szOneStateFalse[] = { '!','O','n','e','>','0',0 };
- static const WCHAR szOneStateTrue[] = { '!','O','n','e','=','-','1',0 };
- static const WCHAR szOneActionFalse[] = { '$','O','n','e','=','-','1',0 };
- static const WCHAR szOneActionTrue[] = { '$','O','n','e','>','0',0 };
- static const WCHAR szCostInitialize[] = { 'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0 };
- static const WCHAR szEmpty[] = { 0 };
- static const WCHAR szEquals[] = { '=',0 };
- static const WCHAR szPropertyName[] = { 'P','r','o','p','e','r','t','y',',','N','a','m','e',0 };
- static const WCHAR szModeFlag[] = { 'M','o','d','e',',','F','l','a','g',0 };
WCHAR stringw[MAX_PATH];
CHAR string[MAX_PATH];
UINT len;
@@ -1885,9 +1851,9 @@ static void test_Session(IDispatch *pSession)
/* Session::Property, get */
memset(stringw, 0, sizeof(stringw));
- hr = Session_PropertyGet(pSession, szProductName, stringw);
+ hr = Session_PropertyGet(pSession, L"ProductName", stringw);
ok(hr == S_OK, "Session_PropertyGet failed, hresult 0x%08x\n", hr);
- if (lstrcmpW(stringw, szMSITEST) != 0)
+ if (lstrcmpW(stringw, L"MSITEST") != 0)
{
len = WideCharToMultiByte(CP_ACP, 0, stringw, -1, string, MAX_PATH, NULL, NULL);
ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError());
@@ -1895,12 +1861,12 @@ static void test_Session(IDispatch *pSession)
}
/* Session::Property, put */
- hr = Session_PropertyPut(pSession, szProductName, szProductName);
+ hr = Session_PropertyPut(pSession, L"ProductName", L"ProductName");
ok(hr == S_OK, "Session_PropertyPut failed, hresult 0x%08x\n", hr);
memset(stringw, 0, sizeof(stringw));
- hr = Session_PropertyGet(pSession, szProductName, stringw);
+ hr = Session_PropertyGet(pSession, L"ProductName", stringw);
ok(hr == S_OK, "Session_PropertyGet failed, hresult 0x%08x\n", hr);
- if (lstrcmpW(stringw, szProductName) != 0)
+ if (lstrcmpW(stringw, L"ProductName") != 0)
{
len = WideCharToMultiByte(CP_ACP, 0, stringw, -1, string, MAX_PATH, NULL, NULL);
ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError());
@@ -1908,12 +1874,12 @@ static void test_Session(IDispatch *pSession)
}
/* Try putting a property using empty property identifier */
- hr = Session_PropertyPut(pSession, szEmpty, szProductName);
+ hr = Session_PropertyPut(pSession, L"", L"ProductName");
ok(hr == DISP_E_EXCEPTION, "Session_PropertyPut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szPropertyName);
+ ok_exception(hr, L"Property,Name");
/* Try putting a property using illegal property identifier */
- hr = Session_PropertyPut(pSession, szEquals, szProductName);
+ hr = Session_PropertyPut(pSession, L"=", L"ProductName");
ok(hr == S_OK, "Session_PropertyPut failed, hresult 0x%08x\n", hr);
/* Session::Language, get */
@@ -1941,7 +1907,7 @@ static void test_Session(IDispatch *pSession)
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_TRUE);
ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModeFlag);
+ ok_exception(hr, L"Mode,Flag");
hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool);
ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr);
@@ -1949,11 +1915,11 @@ static void test_Session(IDispatch *pSession)
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_FALSE); /* set it again so we don't reboot */
ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModeFlag);
+ ok_exception(hr, L"Mode,Flag");
hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, VARIANT_TRUE);
ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szModeFlag);
+ ok_exception(hr, L"Mode,Flag");
/* Session::Database, get */
hr = Session_Database(pSession, &pDatabase);
@@ -1969,16 +1935,16 @@ static void test_Session(IDispatch *pSession)
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szEmpty, &myint);
+ hr = Session_EvaluateCondition(pSession, L"", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szEquals, &myint);
+ hr = Session_EvaluateCondition(pSession, L"=", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_ERROR, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
/* Session::DoAction(CostInitialize) must occur before the next statements */
- hr = Session_DoAction(pSession, szCostInitialize, &myint);
+ hr = Session_DoAction(pSession, L"CostInitialize", &myint);
ok(hr == S_OK, "Session_DoAction failed, hresult 0x%08x\n", hr);
ok(myint == IDOK, "DoAction(CostInitialize) returned %d, %d expected\n", myint, IDOK);
@@ -1987,7 +1953,7 @@ static void test_Session(IDispatch *pSession)
ok(hr == S_OK, "Session_SetInstallLevel failed, hresult 0x%08x\n", hr);
/* Session::FeatureCurrentState, get */
- hr = Session_FeatureCurrentState(pSession, szOne, &myint);
+ hr = Session_FeatureCurrentState(pSession, L"One", &myint);
ok(hr == S_OK, "Session_FeatureCurrentState failed, hresult 0x%08x\n", hr);
ok(myint == INSTALLSTATE_UNKNOWN, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
@@ -1999,27 +1965,27 @@ static void test_Session(IDispatch *pSession)
ok(myint == 0, "Session_Message returned %x\n", myint);
/* Session::EvaluateCondition */
- hr = Session_EvaluateCondition(pSession, szOneStateFalse, &myint);
+ hr = Session_EvaluateCondition(pSession, L"!One>0", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szOneStateTrue, &myint);
+ hr = Session_EvaluateCondition(pSession, L"!One=-1", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
/* Session::FeatureRequestState, put */
- hr = Session_FeatureRequestStatePut(pSession, szOne, INSTALLSTATE_ADVERTISED);
+ hr = Session_FeatureRequestStatePut(pSession, L"One", INSTALLSTATE_ADVERTISED);
ok(hr == S_OK, "Session_FeatureRequestStatePut failed, hresult 0x%08x\n", hr);
- hr = Session_FeatureRequestStateGet(pSession, szOne, &myint);
+ hr = Session_FeatureRequestStateGet(pSession, L"One", &myint);
ok(hr == S_OK, "Session_FeatureRequestStateGet failed, hresult 0x%08x\n", hr);
ok(myint == INSTALLSTATE_ADVERTISED, "Feature request state was %d but expected %d\n", myint, INSTALLSTATE_ADVERTISED);
/* Session::EvaluateCondition */
- hr = Session_EvaluateCondition(pSession, szOneActionFalse, &myint);
+ hr = Session_EvaluateCondition(pSession, L"$One=-1", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szOneActionTrue, &myint);
+ hr = Session_EvaluateCondition(pSession, L"$One>0", &myint);
ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr);
ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
}
@@ -2048,21 +2014,6 @@ static DWORD delete_key( HKEY hkey )
static void test_Installer_RegistryValue(void)
{
static const DWORD qw[2] = { 0x12345678, 0x87654321 };
- static const WCHAR szKey[] = { 'S','o','f','t','w','a','r','e','\\','W','i','n','e','\\','T','e','s','t',0 };
- static const WCHAR szOne[] = { 'O','n','e',0 };
- static const WCHAR szTwo[] = { 'T','w','o',0 };
- static const WCHAR szThree[] = { 'T','h','r','e','e',0 };
- static const WCHAR szREG_BINARY[] = { '(','R','E','G','_','B','I','N','A','R','Y',')',0 };
- static const WCHAR szFour[] = { 'F','o','u','r',0 };
- static const WCHAR szExpand[] = { '%','M','S','I','T','E','S','T','%',0 };
- static const WCHAR szFive[] = { 'F','i','v','e',0,'H','i',0,0 };
- static const WCHAR szFiveHi[] = { 'F','i','v','e','\n','H','i',0 };
- static const WCHAR szSix[] = { 'S','i','x',0 };
- static const WCHAR szREG_[] = { '(','R','E','G','_',']',0 };
- static const WCHAR szREG_2[] = { '(','R','E','G','_','?','?',')',0 };
- static const WCHAR szSeven[] = { 'S','e','v','e','n',0 };
- static const WCHAR szEight[] = { 'E','i','g','h','t',0 };
- static const WCHAR szBlank[] = { 0 };
VARIANT varresult;
VARIANTARG vararg;
WCHAR szString[MAX_PATH];
@@ -2074,7 +2025,7 @@ static void test_Installer_RegistryValue(void)
/* Delete keys */
SetLastError(0xdeadbeef);
- lRet = RegOpenKeyW( HKEY_CURRENT_USER, szKey, &hkey );
+ lRet = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Test", &hkey );
if (!lRet && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("Needed W-functions are not implemented\n");
@@ -2084,129 +2035,129 @@ static void test_Installer_RegistryValue(void)
delete_key( hkey );
/* Does our key exist? Shouldn't; check with all three possible value parameter types */
- hr = Installer_RegistryValueE(curr_user, szKey, &bRet);
+ hr = Installer_RegistryValueE(curr_user, L"Software\\Wine\\Test", &bRet);
ok(hr == S_OK, "Installer_RegistryValueE failed, hresult 0x%08x\n", hr);
ok(!bRet, "Registry key expected to not exist, but Installer_RegistryValue claims it does\n");
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, NULL, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", NULL, szString);
ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, 0, szString, VT_BSTR);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", 0, szString, VT_BSTR);
ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* Create key */
- ok(!RegCreateKeyW( HKEY_CURRENT_USER, szKey, &hkey ), "RegCreateKeyW failed\n");
+ ok(!RegCreateKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Test", &hkey ), "RegCreateKeyW failed\n");
- ok(!RegSetValueExW(hkey,szOne,0,REG_SZ, (const BYTE *)szOne, sizeof(szOne)),
+ ok(!RegSetValueExW(hkey, L"One", 0, REG_SZ, (const BYTE *)L"One", sizeof(L"one")),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,szTwo,0,REG_DWORD, (const BYTE *)qw, 4),
+ ok(!RegSetValueExW(hkey, L"Two", 0, REG_DWORD, (const BYTE *)qw, 4),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,szThree,0,REG_BINARY, (const BYTE *)qw, 4),
+ ok(!RegSetValueExW(hkey, L"Three", 0, REG_BINARY, (const BYTE *)qw, 4),
"RegSetValueExW failed\n");
bRet = SetEnvironmentVariableA("MSITEST", "Four");
ok(bRet, "SetEnvironmentVariableA failed %d\n", GetLastError());
- ok(!RegSetValueExW(hkey,szFour,0,REG_EXPAND_SZ, (const BYTE *)szExpand, sizeof(szExpand)),
+ ok(!RegSetValueExW(hkey, L"Four", 0, REG_EXPAND_SZ, (const BYTE *)L"%MSITEST%", sizeof(L"%MSITEST%")),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,szFive,0,REG_MULTI_SZ, (const BYTE *)szFive, sizeof(szFive)),
+ ok(!RegSetValueExW(hkey, L"Five\0Hi\0", 0, REG_MULTI_SZ, (const BYTE *)L"Five\0Hi\0", sizeof(L"Five\0Hi\0")),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,szSix,0,REG_QWORD, (const BYTE *)qw, 8),
+ ok(!RegSetValueExW(hkey, L"Six", 0, REG_QWORD, (const BYTE *)qw, 8),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,szSeven,0,REG_NONE, NULL, 0),
+ ok(!RegSetValueExW(hkey, L"Seven", 0, REG_NONE, NULL, 0),
"RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,NULL,0,REG_SZ, (const BYTE *)szOne, sizeof(szOne)),
+ ok(!RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE *)L"One", sizeof(L"One")),
"RegSetValueExW failed\n");
- ok(!RegCreateKeyW( hkey, szEight, &hkey_sub ), "RegCreateKeyW failed\n");
+ ok(!RegCreateKeyW( hkey, L"Eight", &hkey_sub ), "RegCreateKeyW failed\n");
/* Does our key exist? It should, and make sure we retrieve the correct default value */
bRet = FALSE;
- hr = Installer_RegistryValueE(curr_user, szKey, &bRet);
+ hr = Installer_RegistryValueE(curr_user, L"Software\\Wine\\Test", &bRet);
ok(hr == S_OK, "Installer_RegistryValueE failed, hresult 0x%08x\n", hr);
ok(bRet, "Registry key expected to exist, but Installer_RegistryValue claims it does not\n");
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, NULL, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", NULL, szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
- ok_w2("Default registry value \"%s\" does not match expected \"%s\"\n", szString, szOne);
+ ok_w2("Default registry value \"%s\" does not match expected \"%s\"\n", szString, L"One");
/* Ask for the value of a nonexistent key */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szExpand, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"%MSITEST%", szString);
ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
/* Get values of keys */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szOne, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"One", szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
- ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, szOne);
+ ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, L"One");
VariantInit(&vararg);
V_VT(&vararg) = VT_BSTR;
- V_BSTR(&vararg) = SysAllocString(szTwo);
- hr = Installer_RegistryValue(curr_user, szKey, vararg, &varresult, VT_I4);
+ V_BSTR(&vararg) = SysAllocString(L"Two");
+ hr = Installer_RegistryValue(curr_user, L"Software\\Wine\\Test", vararg, &varresult, VT_I4);
ok(hr == S_OK, "Installer_RegistryValue failed, hresult 0x%08x\n", hr);
ok(V_I4(&varresult) == 305419896, "Registry value %d does not match expected value\n", V_I4(&varresult));
VariantClear(&varresult);
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szThree, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"Three", szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
- ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, szREG_BINARY);
+ ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, L"(REG_BINARY)");
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szFour, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"Four", szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
- ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, szFour);
+ ok_w2("Registry value \"%s\" does not match expected \"%s\"\n", szString, L"Four");
/* Vista does not NULL-terminate this case */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szFive, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"Five\0Hi\0", szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
ok_w2n("Registry value \"%s\" does not match expected \"%s\"\n",
- szString, szFiveHi, lstrlenW(szFiveHi));
+ szString, L"Five\nHi", lstrlenW(L"Five\nHi"));
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueW(curr_user, szKey, szSix, szString);
+ hr = Installer_RegistryValueW(curr_user, L"Software\\Wine\\Test", L"Six", szString);
ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
- ok(!lstrcmpW(szString, szREG_2) || broken(!lstrcmpW(szString, szREG_)),
+ ok(!lstrcmpW(szString, L"(REG_\?\?)") || broken(!lstrcmpW(szString, L"(REG_]")),
"Registry value does not match\n");
VariantInit(&vararg);
V_VT(&vararg) = VT_BSTR;
- V_BSTR(&vararg) = SysAllocString(szSeven);
- hr = Installer_RegistryValue(curr_user, szKey, vararg, &varresult, VT_EMPTY);
+ V_BSTR(&vararg) = SysAllocString(L"Seven");
+ hr = Installer_RegistryValue(curr_user, L"Software\\Wine\\Test", vararg, &varresult, VT_EMPTY);
ok(hr == S_OK, "Installer_RegistryValue failed, hresult 0x%08x\n", hr);
/* Get string class name for the key */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, 0, szString, VT_BSTR);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", 0, szString, VT_BSTR);
ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
- ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, szBlank);
+ ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, L"");
/* Get name of a value by positive number (RegEnumValue like), valid index */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, 2, szString, VT_BSTR);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", 2, szString, VT_BSTR);
ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* RegEnumValue order seems different on wine */
- todo_wine ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, szTwo);
+ todo_wine ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, L"Two");
/* Get name of a value by positive number (RegEnumValue like), invalid index */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, 10, szString, VT_EMPTY);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", 10, szString, VT_EMPTY);
ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* Get name of a subkey by negative number (RegEnumValue like), valid index */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, -1, szString, VT_BSTR);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", -1, szString, VT_BSTR);
ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
- ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, szEight);
+ ok_w2("Registry name \"%s\" does not match expected \"%s\"\n", szString, L"Eight");
/* Get name of a subkey by negative number (RegEnumValue like), invalid index */
memset(szString, 0, sizeof(szString));
- hr = Installer_RegistryValueI(curr_user, szKey, -10, szString, VT_EMPTY);
+ hr = Installer_RegistryValueI(curr_user, L"Software\\Wine\\Test", -10, szString, VT_EMPTY);
ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* clean up */
@@ -2262,7 +2213,7 @@ static void test_Installer_Products(BOOL bProductInstalled)
ok(iValue == INSTALLSTATE_DEFAULT || iValue == INSTALLSTATE_ADVERTISED, "Installer_ProductState returned %d, expected %d or %d\n", iValue, INSTALLSTATE_DEFAULT, INSTALLSTATE_ADVERTISED);
/* Not found our product code yet? Check */
- if (!bProductFound && !lstrcmpW(szString, szProductCode))
+ if (!bProductFound && !lstrcmpW(szString, L"{837450fa-a39b-4bc8-b321-08b393f784b3}"))
bProductFound = TRUE;
/* IEnumVARIANT::Next */
@@ -2454,7 +2405,7 @@ static void test_Installer_InstallProduct(void)
ok(hr == S_OK, "Expected UILevel property put invoke to return S_OK, got 0x%08x\n", hr);
/* Installer::InstallProduct */
- hr = Installer_InstallProduct(szMsifile, NULL);
+ hr = Installer_InstallProduct(L"winetest-automation.msi", NULL);
if (hr == DISP_E_EXCEPTION)
{
skip("InstallProduct failed, insufficient rights?\n");
@@ -2464,7 +2415,7 @@ static void test_Installer_InstallProduct(void)
ok(hr == S_OK, "Installer_InstallProduct failed, hresult 0x%08x\n", hr);
/* Installer::ProductState for our product code, which has been installed */
- hr = Installer_ProductState(szProductCode, &iValue);
+ hr = Installer_ProductState(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", &iValue);
ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr);
ok(iValue == INSTALLSTATE_DEFAULT, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_DEFAULT);
@@ -2472,33 +2423,33 @@ static void test_Installer_InstallProduct(void)
/* NULL attribute */
memset(szString, 0, sizeof(szString));
- hr = Installer_ProductInfo(szProductCode, NULL, szString);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", NULL, szString);
ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szProductInfoException);
+ ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Nonexistent attribute */
memset(szString, 0, sizeof(szString));
- hr = Installer_ProductInfo(szProductCode, szMsifile, szString);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"winetest-automation.msi", szString);
ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szProductInfoException);
+ ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Package name */
memset(szString, 0, sizeof(szString));
- hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PACKAGENAMEW, szString);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"PackageName", szString);
ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, szMsifile);
+ todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, L"winetest-automation.msi");
/* Product name */
memset(szString, 0, sizeof(szString));
- hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PRODUCTNAMEW, szString);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"ProductName", szString);
ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, szMSITEST);
+ todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, L"MSITEST");
/* Installer::Products */
test_Installer_Products(TRUE);
/* Installer::RelatedProducts for our upgrade code */
- hr = Installer_RelatedProducts(szUpgradeCode, &pStringList);
+ hr = Installer_RelatedProducts(L"{CE067E8D-2E1A-4367-B734-4EB2BDAD6565}", &pStringList);
ok(hr == S_OK, "Installer_RelatedProducts failed, hresult 0x%08x\n", hr);
if (hr == S_OK)
{
@@ -2511,12 +2462,12 @@ static void test_Installer_InstallProduct(void)
memset(szString, 0, sizeof(szString));
hr = StringList_Item(pStringList, 0, szString);
ok(hr == S_OK, "StringList_Item failed (idx 0, count %d), hresult 0x%08x\n", iCount, hr);
- ok_w2("StringList_Item returned %s but expected %s\n", szString, szProductCode);
+ ok_w2("StringList_Item returned %s but expected %s\n", szString, L"{837450fa-a39b-4bc8-b321-08b393f784b3}");
IDispatch_Release(pStringList);
}
- hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_LOCALPACKAGEW, szString);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"LocalPackage", szString);
ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
DeleteFileW( szString );
@@ -2604,8 +2555,6 @@ static void test_Installer_InstallProduct(void)
static void test_Installer(void)
{
- static const WCHAR szCreateRecordException[] = { 'C','r','e','a','t','e','R','e','c','o','r','d',',','C','o','u','n','t',0 };
- static const WCHAR szIntegerDataException[] = { 'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0 };
WCHAR szPath[MAX_PATH];
HRESULT hr;
IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL, *pSumInfo = NULL;
@@ -2618,7 +2567,7 @@ static void test_Installer(void)
/* Test for error */
hr = Installer_CreateRecord(-1, &pRecord);
ok(hr == DISP_E_EXCEPTION, "Installer_CreateRecord failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szCreateRecordException);
+ ok_exception(hr, L"CreateRecord,Count");
/* Test for success */
hr = Installer_CreateRecord(1, &pRecord);
@@ -2648,7 +2597,7 @@ static void test_Installer(void)
/* Record::IntegerDataPut, bad index */
hr = Record_IntegerDataPut(pRecord, 10, 100);
ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szIntegerDataException);
+ ok_exception(hr, L"IntegerData,Field");
/* Record::IntegerDataGet */
hr = Record_IntegerDataGet(pRecord, 1, &iValue);
@@ -2700,7 +2649,7 @@ static void test_Installer(void)
test_Installer_RegistryValue();
/* Installer::ProductState for our product code, which should not be installed */
- hr = Installer_ProductState(szProductCode, &iValue);
+ hr = Installer_ProductState(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", &iValue);
ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr);
ok(iValue == INSTALLSTATE_UNKNOWN, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_UNKNOWN);
@@ -2708,21 +2657,21 @@ static void test_Installer(void)
/* Package name */
memset(szPath, 0, sizeof(szPath));
- hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PACKAGENAMEW, szPath);
+ hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"PackageName", szPath);
ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szProductInfoException);
+ ok_exception(hr, L"ProductInfo,Product,Attribute");
/* NULL attribute and NULL product code */
memset(szPath, 0, sizeof(szPath));
hr = Installer_ProductInfo(NULL, NULL, szPath);
ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr);
- ok_exception(hr, szProductInfoException);
+ ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Installer::Products */
test_Installer_Products(FALSE);
/* Installer::RelatedProducts for our upgrade code, should not find anything */
- hr = Installer_RelatedProducts(szUpgradeCode, &pStringList);
+ hr = Installer_RelatedProducts(L"{CE067E8D-2E1A-4367-B734-4EB2BDAD6565}", &pStringList);
ok(hr == S_OK, "Installer_RelatedProducts failed, hresult 0x%08x\n", hr);
if (hr == S_OK)
{
@@ -2772,7 +2721,7 @@ START_TEST(automation)
hr = OleInitialize(NULL);
ok (hr == S_OK, "OleInitialize returned 0x%08x\n", hr);
- hr = CLSIDFromProgID(szProgId, &clsid);
+ hr = CLSIDFromProgID(L"WindowsInstaller.Installer", &clsid);
ok (hr == S_OK, "CLSIDFromProgID returned 0x%08x\n", hr);
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
ok(hr == S_OK, "CoCreateInstance returned 0x%08x\n", hr);
diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c
index 504f32cf96f..caf24356948 100644
--- a/dlls/msi/tests/custom.c
+++ b/dlls/msi/tests/custom.c
@@ -106,9 +106,6 @@ static void check_prop(MSIHANDLE hinst, const char *prop, const char *expect)
static void test_props(MSIHANDLE hinst)
{
- static const WCHAR booW[] = {'b','o','o',0};
- static const WCHAR xyzW[] = {'x','y','z',0};
- static const WCHAR xyW[] = {'x','y',0};
char buffer[10];
WCHAR bufferW[10];
DWORD sz;
@@ -219,43 +216,43 @@ static void test_props(MSIHANDLE hinst)
ok(hinst, !strcmp(buffer, "xyz"), "got \"%s\"\n", buffer);
ok(hinst, sz == 3, "got size %u\n", sz);
- r = MsiGetPropertyW(hinst, booW, NULL, NULL);
+ r = MsiGetPropertyW(hinst, L"boo", NULL, NULL);
ok(hinst, !r, "got %u\n", r);
- r = MsiGetPropertyW(hinst, booW, bufferW, NULL );
+ r = MsiGetPropertyW(hinst, L"boo", bufferW, NULL );
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
sz = 0;
- r = MsiGetPropertyW(hinst, booW, NULL, &sz);
+ r = MsiGetPropertyW(hinst, L"boo", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, booW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"boo"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 1;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 3;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"xy"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 4;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"xyz"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
r = MsiSetPropertyA(hinst, "boo", NULL);
@@ -566,9 +563,6 @@ UINT WINAPI nested(MSIHANDLE hinst)
static void test_targetpath(MSIHANDLE hinst)
{
- static const WCHAR targetdirW[] = {'T','A','R','G','E','T','D','I','R',0};
- static const WCHAR xyzW[] = {'C',':','\\',0};
- static const WCHAR xyW[] = {'C',':',0};
WCHAR bufferW[100];
char buffer[100];
DWORD sz, srcsz;
@@ -621,36 +615,36 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
- r = MsiGetTargetPathW(hinst, targetdirW, NULL, &sz);
+ r = MsiGetTargetPathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
bufferW[0] = 'q';
- r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
- r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 3;
bufferW[0] = 'q';
- r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 4;
bufferW[0] = 'q';
- r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"C:\\"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
r = MsiSetTargetPathA(hinst, NULL, "C:\\subdir");
@@ -684,7 +678,7 @@ static void test_targetpath(MSIHANDLE hinst)
* Seems to be a casualty of RPC... */
srcsz = 0;
- MsiGetSourcePathW(hinst, targetdirW, NULL, &srcsz);
+ MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &srcsz);
sz = 0;
r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, &sz);
@@ -720,34 +714,34 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 0;
- r = MsiGetSourcePathW(hinst, targetdirW, NULL, &sz);
+ r = MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 0;
bufferW[0] = 'q';
- r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
- r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = srcsz;
bufferW[0] = 'q';
- r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz - 1, "wrong buffer length %d\n", lstrlenW(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = srcsz + 1;
bufferW[0] = 'q';
- r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
+ r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz, "wrong buffer length %d\n", lstrlenW(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
@@ -870,8 +864,6 @@ static void test_feature_states(MSIHANDLE hinst)
static void test_format_record(MSIHANDLE hinst)
{
- static const WCHAR xyzW[] = {'f','o','o',' ','1','2','3',0};
- static const WCHAR xyW[] = {'f','o','o',' ','1','2',0};
WCHAR bufferW[10];
char buffer[10];
MSIHANDLE rec;
@@ -955,14 +947,14 @@ static void test_format_record(MSIHANDLE hinst)
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"foo 12"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 7, "got size %u\n", sz);
sz = 8;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"foo 123"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 7, "got size %u\n", sz);
/* check that properties work */
@@ -979,9 +971,6 @@ static void test_format_record(MSIHANDLE hinst)
static void test_costs(MSIHANDLE hinst)
{
- static const WCHAR oneW[] = {'O','n','e',0};
- static const WCHAR xyzW[] = {'C',':',0};
- static const WCHAR xyW[] = {'C',0};
WCHAR bufferW[10];
char buffer[10];
int cost, temp;
@@ -1085,30 +1074,30 @@ static void test_costs(MSIHANDLE hinst)
sz = 0;
bufferW[0] = 'q';
- r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
+ r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
- r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
+ r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 2;
bufferW[0] = 'q';
- r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
+ r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"C"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 3;
bufferW[0] = 'q';
- r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
+ r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
- ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
+ ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
}
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 3e1c551d38f..4ffd30f0376 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -33,8 +33,8 @@
static const char *msifile = "winetest-db.msi";
static const char *msifile2 = "winetst2-db.msi";
static const char *mstfile = "winetst-db.mst";
-static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','-','d','b','.','m','s','i',0};
-static const WCHAR msifile2W[] = {'w','i','n','e','t','s','t','2','-','d','b','.','m','s','i',0};
+static const WCHAR msifileW[] = L"winetest-db.msi";
+static const WCHAR msifile2W[] = L"winetst2-db.msi";
static void WINAPIV check_record_(int line, MSIHANDLE rec, UINT count, ...)
{
@@ -1428,7 +1428,7 @@ static void test_msiexport(void)
static void test_longstrings(void)
{
- const char insert_query[] =
+ const char insert_query[] =
"INSERT INTO `strings` ( `id`, `val` ) VALUES('1', 'Z')";
char *str;
MSIHANDLE hdb = 0, hview = 0, hrec = 0;
@@ -1442,7 +1442,7 @@ static void test_longstrings(void)
ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
/* create a table */
- r = try_query( hdb,
+ r = try_query( hdb,
"CREATE TABLE `strings` ( `id` INT, `val` CHAR(0) PRIMARY KEY `id`)");
ok(r == ERROR_SUCCESS, "query failed\n");
@@ -1507,7 +1507,7 @@ static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
}
#define create_file(name) create_file_data(name, name, 0)
-
+
static void test_streamtable(void)
{
MSIHANDLE hdb = 0, rec, view, hsi;
@@ -2740,7 +2740,7 @@ static void test_handle_limit(void)
static char szQueryBuf[256] = "SELECT * from `_Tables`";
hviews[i] = 0xdeadbeeb;
r = MsiDatabaseOpenViewA(hdb, szQueryBuf, &hviews[i]);
- if( r != ERROR_SUCCESS || hviews[i] == 0xdeadbeeb ||
+ if( r != ERROR_SUCCESS || hviews[i] == 0xdeadbeeb ||
hviews[i] == 0 || (i && (hviews[i] == hviews[i-1])))
break;
}
@@ -4776,34 +4776,6 @@ static void test_rows_order(void)
static void test_collation(void)
{
- static const WCHAR query1[] =
- {'I','N','S','E','R','T',' ','I','N','T','O',' ','`','b','a','r','`',' ',
- '(','`','f','o','o','`',',','`','b','a','z','`',')',' ','V','A','L','U','E','S',' ',
- '(','\'','a',0x30a,'\'',',','\'','C','\'',')',0};
- static const WCHAR query2[] =
- {'I','N','S','E','R','T',' ','I','N','T','O',' ','`','b','a','r','`',' ',
- '(','`','f','o','o','`',',','`','b','a','z','`',')',' ','V','A','L','U','E','S',' ',
- '(','\'',0xe5,'\'',',','\'','D','\'',')',0};
- static const WCHAR query3[] =
- {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','b','a','z','`',' ',
- '(',' ','`','a',0x30a,'`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ','N','U','L','L',',',
- ' ','`',0xe5,'`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ','N','U','L','L',' ',
- 'P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','a',0x30a,'`',')',0};
- static const WCHAR query4[] =
- {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','a',0x30a,'`',' ',
- '(',' ','`','f','o','o','`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ',
- 'N','U','L','L',' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','f','o','o','`',')',0};
- static const WCHAR query5[] =
- {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`',0xe5,'`',' ',
- '(',' ','`','f','o','o','`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ',
- 'N','U','L','L',' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','f','o','o','`',')',0};
- static const WCHAR query6[] =
- {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','b','a','r','`',' ','W','H','E','R','E',
- ' ','`','f','o','o','`',' ','=','\'',0xe5,'\'',0};
- static const WCHAR letter_C[] = {'C',0};
- static const WCHAR letter_D[] = {'D',0};
- static const WCHAR letter_a_ring[] = {'a',0x30a,0};
- static const WCHAR letter_a_with_ring[] = {0xe5,0};
const char *query;
MSIHANDLE hdb = 0, hview = 0, hrec = 0;
UINT r;
@@ -4832,19 +4804,19 @@ static void test_collation(void)
"( `foo`, `baz` ) VALUES ( '\1', 'B' )");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
- r = run_queryW(hdb, 0, query1);
+ r = run_queryW(hdb, 0, L"INSERT INTO `bar` (`foo`,`baz`) VALUES ('a\x30a','C')");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
- r = run_queryW(hdb, 0, query2);
+ r = run_queryW(hdb, 0, L"INSERT INTO `bar` (`foo`,`baz`) VALUES ('\xe5','D')");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
- r = run_queryW(hdb, 0, query3);
+ r = run_queryW(hdb, 0, L"CREATE TABLE `baz` ( `a\x30a` LONGCHAR NOT NULL, `\xe5` LONGCHAR NOT NULL PRIMARY KEY `a\x30a`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
- r = run_queryW(hdb, 0, query4);
+ r = run_queryW(hdb, 0, L"CREATE TABLE `a\x30a` ( `foo` LONGCHAR NOT NULL PRIMARY KEY `foo`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
- r = run_queryW(hdb, 0, query5);
+ r = run_queryW(hdb, 0, L"CREATE TABLE `\xe5` ( `foo` LONGCHAR NOT NULL PRIMARY KEY `foo`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
query = "SELECT * FROM `bar`";
@@ -4882,12 +4854,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!memcmp(bufferW, letter_a_ring, sizeof(letter_a_ring)),
- "Expected %s, got %s\n", wine_dbgstr_w(letter_a_ring), wine_dbgstr_w(bufferW));
+ ok(!memcmp(bufferW, L"a\x30a", sizeof(L"a\x30a")),
+ "Expected %s, got %s\n", wine_dbgstr_w(L"a\x30a"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpW(bufferW, letter_C), "Expected C, got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"C"), "Expected C, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewFetch(hview, &hrec);
@@ -4895,12 +4867,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
- "Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
+ ok(!memcmp(bufferW, L"\xe5", sizeof(L"\xe5")),
+ "Expected %s, got %s\n", wine_dbgstr_w(L"\xe5"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"D"), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewClose(hview);
@@ -4908,7 +4880,7 @@ static void test_collation(void)
r = MsiCloseHandle(hview);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
- r = MsiDatabaseOpenViewW(hdb, query6, &hview);
+ r = MsiDatabaseOpenViewW(hdb, L"SELECT * FROM `bar` WHERE `foo` ='\xe5'", &hview);
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
r = MsiViewExecute(hview, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
@@ -4918,12 +4890,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
- "Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
+ ok(!memcmp(bufferW, L"\xe5", sizeof(L"\xe5")),
+ "Expected %s, got %s\n", wine_dbgstr_w(L"\xe5"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"D"), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewFetch(hview, &hrec);
@@ -7539,7 +7511,6 @@ static void test_droptable(void)
static void test_dbmerge(void)
{
- static const WCHAR refdbW[] = {'r','e','f','d','b','.','m','s','i',0};
MSIHANDLE hdb, href, hview, hrec;
CHAR buf[MAX_PATH];
LPCSTR query;
@@ -7549,7 +7520,7 @@ static void test_dbmerge(void)
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- r = MsiOpenDatabaseW(refdbW, MSIDBOPEN_CREATE, &href);
+ r = MsiOpenDatabaseW(L"refdb.msi", MSIDBOPEN_CREATE, &href);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* hDatabase is invalid */
@@ -8090,7 +8061,7 @@ static void test_dbmerge(void)
MsiCloseHandle(hdb);
MsiCloseHandle(href);
DeleteFileA(msifile);
- DeleteFileW(refdbW);
+ DeleteFileW(L"refdb.msi");
DeleteFileA("codepage.idt");
DeleteFileA("binary.dat");
}
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 2cfa810e1da..ce650b84d61 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -59,8 +59,8 @@ static const char *msifile = "msitest.msi";
static const char *msifile2 = "winetest2.msi";
static const char *mstfile = "winetest.mst";
-static const WCHAR msifileW[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
-static const WCHAR msifile2W[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
+static const WCHAR msifileW[] = L"msitest.msi";
+static const WCHAR msifile2W[] = L"msitest2.msi";
char CURR_DIR[MAX_PATH];
char PROG_FILES_DIR[MAX_PATH];
@@ -2209,7 +2209,7 @@ static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *
{
HANDLE handle = (HANDLE)hf;
DWORD ret;
-
+
ret = SetFilePointer(handle, dist, NULL, seektype);
ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
@@ -3995,11 +3995,6 @@ static void set_admin_property_stream(LPCSTR file)
DWORD count;
const DWORD mode = STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
- /* AdminProperties */
- static const WCHAR stmname[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
- static const WCHAR data[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
- 'M','y','P','r','o','p','=','4','2',0};
-
MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
@@ -4007,10 +4002,11 @@ static void set_admin_property_stream(LPCSTR file)
if (!stg)
return;
- hr = IStorage_CreateStream(stg, stmname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
+ hr = IStorage_CreateStream(stg, L"\x41ca\x4330\x3e71\x44b5\x4233\x45f5\x422c\x4836",
+ STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
- hr = IStream_Write(stm, data, sizeof(data), &count);
+ hr = IStream_Write(stm, L"MYPROP=2718 MyProp=42", sizeof(L"MYPROP=2718 MyProp=42"), &count);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
IStream_Release(stm);
@@ -4983,9 +4979,6 @@ error:
static void test_int_widths( void )
{
- static const WCHAR msitestW[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
- static const WCHAR msitableW[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
- static const WCHAR slashW[] = {'\\',0};
static const char int0[] = "int0\ni0\nint0\tint0\n1";
static const char int1[] = "int1\ni1\nint1\tint1\n1";
static const char int2[] = "int2\ni2\nint2\tint2\n1";
@@ -5017,12 +5010,10 @@ static void test_int_widths( void )
CreateDirectoryW(tmpdir, NULL);
lstrcpyW(msitable, tmpdir);
- lstrcatW(msitable, slashW);
- lstrcatW(msitable, msitableW);
+ lstrcatW(msitable, L"\\msitable.idt");
lstrcpyW(msidb, tmpdir);
- lstrcatW(msidb, slashW);
- lstrcatW(msidb, msitestW);
+ lstrcatW(msidb, L"\\msitest.msi");
r = MsiOpenDatabaseW(msidb, MSIDBOPEN_CREATE, &db);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5035,7 +5026,7 @@ static void test_int_widths( void )
WriteFile(handle, tests[i].data, tests[i].size, &count, NULL);
CloseHandle(handle);
- r = MsiDatabaseImportW(db, tmpdir, msitableW);
+ r = MsiDatabaseImportW(db, tmpdir, L"msitable.idt");
ok(r == tests[i].ret, " %u expected %u, got %u\n", i, tests[i].ret, r);
r = MsiDatabaseCommit(db);
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index eb547c98dce..5e0fa680c89 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -39,7 +39,7 @@
static BOOL is_wow64;
static const char msifile[] = "winetest.msi";
-static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','.','m','s','i',0};
+static const WCHAR msifileW[] = L"winetest.msi";
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
@@ -892,19 +892,19 @@ static void test_usefeature(void)
r = pMsiUseFeatureExA(NULL, "WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
+ r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
NULL, -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
+ r = pMsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
+ r = pMsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
- r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
+ r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
}
@@ -3379,14 +3379,6 @@ static void test_MsiGetComponentPathEx(void)
static void test_MsiProvideComponent(void)
{
- static const WCHAR sourcedirW[] =
- {'s','o','u','r','c','e','d','i','r',0};
- static const WCHAR productW[] =
- {'{','3','8','8','4','7','3','3','8','-','1','B','B','C','-','4','1','0','4','-',
- '8','1','A','C','-','2','F','A','A','C','7','E','C','D','D','C','D','}',0};
- static const WCHAR componentW[] =
- {'{','D','D','4','2','2','F','9','2','-','3','E','D','8','-','4','9','B','5','-',
- 'A','0','B','7','-','F','2','6','6','F','9','8','3','5','7','D','F','}',0};
INSTALLSTATE state;
char buf[0x100];
WCHAR bufW[0x100];
@@ -3445,21 +3437,21 @@ static void test_MsiProvideComponent(void)
bufW[0] = 0;
len = sizeof(buf);
- r = pMsiProvideComponentW(productW, sourcedirW, componentW,
- INSTALLMODE_NODETECTION, bufW, &len);
+ r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(bufW[0], "empty path\n");
ok(len == lstrlenW(bufW), "got %u\n", len);
len2 = 0;
- r = pMsiProvideComponentW(productW, sourcedirW, componentW,
- INSTALLMODE_NODETECTION, NULL, &len2);
+ r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, NULL, &len2);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(len2 == len, "got %u\n", len2);
len2 = 0;
- r = pMsiProvideComponentW(productW, sourcedirW, componentW,
- INSTALLMODE_NODETECTION, bufW, &len2);
+ r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
+ L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len2);
ok(r == ERROR_MORE_DATA, "got %u\n", r);
ok(len2 == len, "got %u\n", len2);
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index bf83c116fff..f8bf431883b 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -35,8 +35,7 @@
static BOOL is_wow64;
static const char msifile[] = "winetest-package.msi";
-static const WCHAR msifileW[] =
- {'w','i','n','e','t','e','s','t','-','p','a','c','k','a','g','e','.','m','s','i',0};
+static const WCHAR msifileW[] = L"winetest-package.msi";
static char CURR_DIR[MAX_PATH];
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD);
@@ -1137,8 +1136,6 @@ static void test_doaction( void )
static void test_gettargetpath_bad(void)
{
- static const WCHAR boo[] = {'b','o','o',0};
- static const WCHAR empty[] = {0};
char buffer[0x80];
WCHAR bufferW[0x80];
MSIHANDLE hpkg;
@@ -1182,20 +1179,20 @@ static void test_gettargetpath_bad(void)
r = MsiGetTargetPathW( 0, NULL, NULL, &sz );
ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
- r = MsiGetTargetPathW( 0, boo, NULL, NULL );
+ r = MsiGetTargetPathW( 0, L"boo", NULL, NULL );
ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
- r = MsiGetTargetPathW( 0, boo, NULL, NULL );
+ r = MsiGetTargetPathW( 0, L"boo", NULL, NULL );
ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
- r = MsiGetTargetPathW( hpkg, boo, NULL, NULL );
+ r = MsiGetTargetPathW( hpkg, L"boo", NULL, NULL );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
- r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL );
+ r = MsiGetTargetPathW( hpkg, L"boo", bufferW, NULL );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
sz = 0;
- r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz );
+ r = MsiGetTargetPathW( hpkg, L"", bufferW, &sz );
ok( r == ERROR_DIRECTORY, "wrong return val\n");
MsiCloseHandle( hpkg );
@@ -1391,10 +1388,6 @@ static void test_settargetpath(void)
static void test_condition(void)
{
- static const WCHAR cond1[] = {'\"','a',0x30a,'\"','<','\"',0xe5,'\"',0};
- static const WCHAR cond2[] = {'\"','a',0x30a,'\"','>','\"',0xe5,'\"',0};
- static const WCHAR cond3[] = {'\"','a',0x30a,'\"','<','>','\"',0xe5,'\"',0};
- static const WCHAR cond4[] = {'\"','a',0x30a,'\"','=','\"',0xe5,'\"',0};
MSICONDITION r;
MSIHANDLE hpkg;
@@ -2126,19 +2119,19 @@ static void test_condition(void)
r = MsiEvaluateConditionA(hpkg, "A <= X");
ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond1);
+ r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<\"\xe5\"");
ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
"wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond2);
+ r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\">\"\xe5\"");
ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
"wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond3);
+ r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"<>\"\xe5\"");
ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE),
"wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond4);
+ r = MsiEvaluateConditionW(hpkg, L"\"a\x30a\"=\"\xe5\"");
ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE),
"wrong return val (%d)\n", r);
@@ -2161,9 +2154,6 @@ static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int
static void test_props(void)
{
- static const WCHAR booW[] = {'b','o','o',0};
- static const WCHAR xyzW[] = {'x','y','z',0};
- static const WCHAR xyW[] = {'x','y',0};
MSIHANDLE hpkg, hdb;
UINT r;
DWORD sz;
@@ -2296,36 +2286,36 @@ static void test_props(void)
ok(sz == 3, "got size %u\n", sz);
sz = 0;
- r = MsiGetPropertyW(hpkg, booW, NULL, &sz);
+ r = MsiGetPropertyW(hpkg, L"boo", NULL, &sz);
ok(!r, "got %u\n", r);
ok(sz == 3, "got size %u\n", sz);
sz = 0;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hpkg, booW, bufferW, &sz);
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz);
ok(r == ERROR_MORE_DATA, "got %u\n", r);
- ok(!lstrcmpW(bufferW, booW), "got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"boo"), "got %s\n", wine_dbgstr_w(bufferW));
ok(sz == 3, "got size %u\n", sz);
sz = 1;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hpkg, booW, bufferW, &sz );
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz );
ok(r == ERROR_MORE_DATA, "got %u\n", r);
ok(!bufferW[0], "got %s\n", wine_dbgstr_w(bufferW));
ok(sz == 3, "got size %u\n", sz);
sz = 3;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hpkg, booW, bufferW, &sz );
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz );
ok(r == ERROR_MORE_DATA, "got %u\n", r);
- ok(!lstrcmpW(bufferW, xyW), "got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"xy"), "got %s\n", wine_dbgstr_w(bufferW));
ok(sz == 3, "got size %u\n", sz);
sz = 4;
- lstrcpyW(bufferW, booW);
- r = MsiGetPropertyW(hpkg, booW, bufferW, &sz );
+ lstrcpyW(bufferW, L"boo");
+ r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz );
ok(!r, "got %u\n", r);
- ok(!lstrcmpW(bufferW, xyzW), "got %s\n", wine_dbgstr_w(bufferW));
+ ok(!lstrcmpW(bufferW, L"xyz"), "got %s\n", wine_dbgstr_w(bufferW));
ok(sz == 3, "got size %u\n", sz);
/* properties are case-sensitive */
@@ -3074,12 +3064,9 @@ static void test_states(void)
static const char msifile2[] = "winetest2-package.msi";
static const char msifile3[] = "winetest3-package.msi";
static const char msifile4[] = "winetest4-package.msi";
- static const WCHAR msifile2W[] =
- {'w','i','n','e','t','e','s','t','2','-','p','a','c','k','a','g','e','.','m','s','i',0};
- static const WCHAR msifile3W[] =
- {'w','i','n','e','t','e','s','t','3','-','p','a','c','k','a','g','e','.','m','s','i',0};
- static const WCHAR msifile4W[] =
- {'w','i','n','e','t','e','s','t','4','-','p','a','c','k','a','g','e','.','m','s','i',0};
+ static const WCHAR msifile2W[] = L"winetest2-package.msi";
+ static const WCHAR msifile3W[] = L"winetest3-package.msi";
+ static const WCHAR msifile4W[] = L"winetest4-package.msi";
char msi_cache_file[MAX_PATH];
DWORD cache_file_name_len;
INSTALLSTATE state;
@@ -4011,7 +3998,7 @@ static void test_removefiles(void)
ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n");
- ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
+ ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n");
ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n");
ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n");
ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n");
@@ -7959,11 +7946,6 @@ static void test_emptypackage(void)
static void test_MsiGetProductProperty(void)
{
- static const WCHAR prodcode_propW[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
- static const WCHAR nonexistentW[] = {'I','D','o','n','t','E','x','i','s','t',0};
- static const WCHAR newpropW[] = {'N','e','w','P','r','o','p','e','r','t','y',0};
- static const WCHAR appleW[] = {'a','p','p','l','e',0};
- static const WCHAR emptyW[] = {0};
WCHAR valW[MAX_PATH];
MSIHANDLE hprod, hdb;
CHAR val[MAX_PATH];
@@ -8069,11 +8051,11 @@ static void test_MsiGetProductProperty(void)
ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(0xdeadbeef, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(0xdeadbeef, L"ProductCode", valW, &size);
ok(r == ERROR_INVALID_HANDLE,
"Expected ERROR_INVALID_HANDLE, got %d\n", r);
- ok(!lstrcmpW(valW, appleW),
+ ok(!lstrcmpW(valW, L"apple"),
"Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW));
ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
@@ -8088,11 +8070,11 @@ static void test_MsiGetProductProperty(void)
ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
+ lstrcpyW(valW, L"apple");
r = MsiGetProductPropertyW(hprod, NULL, valW, &size);
ok(r == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpW(valW, appleW),
+ ok(!lstrcmpW(valW, L"apple"),
"Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW));
ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
@@ -8105,8 +8087,8 @@ static void test_MsiGetProductProperty(void)
ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, emptyW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(*valW == 0, "Expected \"\", got %s\n", wine_dbgstr_w(valW));
ok(size == 0, "Expected 0, got %d\n", size);
@@ -8122,8 +8104,8 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(valW, prodcodeW),
"Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW));
@@ -8138,7 +8120,7 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH;
- r = MsiGetProductPropertyW(hprod, prodcode_propW, NULL, &size);
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", NULL, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(size == lstrlenW(prodcodeW),
"Expected %d, got %d\n", lstrlenW(prodcodeW), size);
@@ -8153,11 +8135,11 @@ static void test_MsiGetProductProperty(void)
ok(size == lstrlenA(prodcode),
"Expected %d, got %d\n", lstrlenA(prodcode), size);
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, NULL);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, NULL);
ok(r == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- ok(!lstrcmpW(valW, appleW),
+ ok(!lstrcmpW(valW, L"apple"),
"Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW));
ok(size == lstrlenW(prodcodeW),
"Expected %d, got %d\n", lstrlenW(prodcodeW), size);
@@ -8173,8 +8155,8 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = 4;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!memcmp(valW, prodcodeW, 3 * sizeof(WCHAR)),
"Expected first 3 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW));
@@ -8192,8 +8174,8 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = lstrlenW(prodcodeW);
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size);
ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r);
ok(!memcmp(valW, prodcodeW, lstrlenW(prodcodeW) - 1),
"Expected first 37 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW));
@@ -8211,8 +8193,8 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = lstrlenW(prodcodeW) + 1;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(valW, prodcodeW),
"Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW));
@@ -8228,10 +8210,10 @@ static void test_MsiGetProductProperty(void)
ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, nonexistentW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"IDontExist", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpW(valW, emptyW), "Expected \"\", got %s\n", wine_dbgstr_w(valW));
+ ok(!lstrcmpW(valW, L""), "Expected \"\", got %s\n", wine_dbgstr_w(valW));
ok(size == 0, "Expected 0, got %d\n", size);
r = MsiSetPropertyA(hprod, "NewProperty", "value");
@@ -8246,10 +8228,10 @@ static void test_MsiGetProductProperty(void)
ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, newpropW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"NewProperty", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpW(valW, emptyW), "Expected \"\", got %s\n", wine_dbgstr_w(valW));
+ ok(!lstrcmpW(valW, L""), "Expected \"\", got %s\n", wine_dbgstr_w(valW));
ok(size == 0, "Expected 0, got %d\n", size);
r = MsiSetPropertyA(hprod, "ProductCode", "value");
@@ -8266,8 +8248,8 @@ static void test_MsiGetProductProperty(void)
"Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH;
- lstrcpyW(valW, appleW);
- r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size);
+ lstrcpyW(valW, L"apple");
+ r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(valW, prodcodeW),
"Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW));
diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c
index 87f64d6c835..65b3a5f1d48 100644
--- a/dlls/msi/tests/patch.c
+++ b/dlls/msi/tests/patch.c
@@ -39,10 +39,8 @@ static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, L
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
-static const WCHAR msifileW[] =
- {'w','i','n','e','t','e','s','t','-','p','a','t','c','h','.','m','s','i',0};
-static const WCHAR mspfileW[] =
- {'w','i','n','e','t','e','s','t','-','p','a','t','c','h','.','m','s','p',0};
+static const WCHAR msifileW[] = L"winetest-patch.msi";
+static const WCHAR mspfileW[] = L"winetest-patch.msp";
static char CURR_DIR[MAX_PATH];
static char PROG_FILES_DIR[MAX_PATH];
@@ -1001,14 +999,11 @@ static UINT find_entry( MSIHANDLE hdb, const char *table, const char *entry )
static UINT find_entryW( MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry )
{
- static const WCHAR fmt[] =
- {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','%','s','`',' ',
- 'W','H','E','R','E',' ','`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0};
WCHAR query[0x100];
MSIHANDLE hview, hrec;
UINT r;
- wsprintfW( query, fmt, table, entry );
+ wsprintfW( query, L"SELECT * FROM `%s` WHERE `Name` = '%s'", table, entry );
r = MsiDatabaseOpenViewW( hdb, query, &hview );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
@@ -1086,8 +1081,6 @@ static char *get_string( MSIHANDLE hdb, UINT field, const char *query)
static void test_system_tables( void )
{
static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7";
- static const WCHAR streamsW[] = {'_','S','t','r','e','a','m','s',0};
- static const WCHAR CAB_msitest_encodedW[] = {0x3a8c,0x47cb,0x45b0,0x45ec,0x45a8,0x4837,0};
UINT r;
char *cr;
const char *query;
@@ -1193,7 +1186,7 @@ static void test_system_tables( void )
r = find_entry( hdb, "_Streams", "\5SummaryInformation" );
ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
- r = find_entryW( hdb, streamsW, CAB_msitest_encodedW );
+ r = find_entryW( hdb, L"_Streams", L"\x3a8c\x47cb\x45b0\x45ec\x45a8\x4837" );
ok( r == ERROR_NO_MORE_ITEMS, "failed to find entry %u\n", r );
query = "SELECT * FROM `_Storages`";
diff --git a/dlls/msi/tests/record.c b/dlls/msi/tests/record.c
index d0ad15b8fef..8e4c2df4294 100644
--- a/dlls/msi/tests/record.c
+++ b/dlls/msi/tests/record.c
@@ -25,8 +25,7 @@
#include "wine/test.h"
static const char *msifile = "winetest-record.msi";
-static const WCHAR msifileW[] =
- {'w','i','n','e','t','e','s','t','-','r','e','c','o','r','d','.','m','s','i',0};
+static const WCHAR msifileW[] = L"winetest-record.msi";
static BOOL create_temp_file(char *name)
{
@@ -34,7 +33,7 @@ static BOOL create_temp_file(char *name)
unsigned char buffer[26], i;
DWORD sz;
HANDLE handle;
-
+
r = GetTempFileNameA(".", "msitest",0,name);
if(!r)
return r;
@@ -338,7 +337,7 @@ static void test_msirecord(void)
ok(r == ERROR_SUCCESS, "Failed to close handle\n");
/* now try streams in a new record - need to create a file to play with */
- r = create_temp_file(filename);
+ r = create_temp_file(filename);
if(!r)
return;
diff --git a/dlls/msi/tests/suminfo.c b/dlls/msi/tests/suminfo.c
index 8c2e292ab8f..1ef18310206 100644
--- a/dlls/msi/tests/suminfo.c
+++ b/dlls/msi/tests/suminfo.c
@@ -64,8 +64,7 @@
#define PID_MSIRESTRICT PID_CHARCOUNT
static const char *msifile = "winetest-suminfo.msi";
-static const WCHAR msifileW[] = {
- 'w','i','n','e','t','e','s','t','-','s','u','m','i','n','f','o','.','m','s','i',0 };
+static const WCHAR msifileW[] = L"winetest-suminfo.msi";
static void test_suminfo(void)
{
--
2.28.0
1
0
[PATCH 1/2] msi: Use wide character string literals in the remaining files.
by Hans Leidekker Oct. 29, 2020
by Hans Leidekker Oct. 29, 2020
Oct. 29, 2020
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/msi/appsearch.c | 101 +++++++----------------
dlls/msi/assembly.c | 100 ++++++----------------
dlls/msi/automation.c | 20 ++---
dlls/msi/cond.y | 75 ++++++++---------
dlls/msi/custom.c | 97 ++++++++--------------
dlls/msi/database.c | 187 +++++++++++++-----------------------------
dlls/msi/delete.c | 2 +-
dlls/msi/distinct.c | 2 +-
dlls/msi/files.c | 51 +++++-------
dlls/msi/font.c | 43 +++-------
dlls/msi/format.c | 7 +-
dlls/msi/install.c | 41 +++++----
dlls/msi/media.c | 23 ++----
dlls/msi/msi.c | 8 +-
dlls/msi/msipriv.h | 105 ------------------------
dlls/msi/msiquery.c | 22 ++---
dlls/msi/patch.c | 107 ++++++++----------------
dlls/msi/record.c | 5 +-
dlls/msi/script.c | 12 +--
dlls/msi/select.c | 8 +-
dlls/msi/source.c | 72 +++++++---------
dlls/msi/sql.y | 3 +-
dlls/msi/storages.c | 6 +-
dlls/msi/streams.c | 8 +-
dlls/msi/string.c | 18 ++--
dlls/msi/suminfo.c | 29 ++++---
dlls/msi/table.c | 111 +++++++++++--------------
dlls/msi/upgrade.c | 19 ++---
dlls/msi/where.c | 2 +-
29 files changed, 420 insertions(+), 864 deletions(-)
diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c
index dd58ccad702..abd3c9d3fd9 100644
--- a/dlls/msi/appsearch.c
+++ b/dlls/msi/appsearch.c
@@ -82,13 +82,7 @@ void msi_parse_version_string(LPCWSTR verStr, PDWORD ms, PDWORD ls)
*/
static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *name )
{
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ',
- 'S','i','g','n','a','t','u','r','e',' ',
- 'w','h','e','r','e',' ','S','i','g','n','a','t','u','r','e',' ','=',' ',
- '\'','%','s','\'',0};
- LPWSTR minVersion, maxVersion, p;
+ WCHAR *minVersion, *maxVersion, *p;
MSIRECORD *row;
DWORD time;
@@ -96,7 +90,7 @@ static UINT get_signature( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHAR *
memset(sig, 0, sizeof(*sig));
sig->Name = name;
- row = MSI_QueryGetRecord( package->db, query, name );
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Signature` WHERE `Signature` = '%s'", name );
if (!row)
{
TRACE("failed to query signature for %s\n", debugstr_w(name));
@@ -195,7 +189,7 @@ static WCHAR *search_file( MSIPACKAGE *package, WCHAR *path, MSISIGNATURE *sig )
if (!size)
goto done;
- if (!VerQueryValueW(buffer, szBackSlash, (LPVOID)&info, &size) || !info)
+ if (!VerQueryValueW(buffer, L"\\", (LPVOID)&info, &size) || !info)
goto done;
if (sig->MinVersionLS || sig->MinVersionMS)
@@ -227,17 +221,6 @@ done:
static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ',
- '`','C','o','m','p','L','o','c','a','t','o','r','`',' ',
- 'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','_','`',' ','=',' ',
- '\'','%','s','\'',0};
- static const WCHAR sigquery[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','S','i','g','n','a','t','u','r','e','`',' ',
- 'W','H','E','R','E',' ','`','S','i','g','n','a','t','u','r','e','`',' ','=',' ',
- '\'','%','s','\'',0};
MSIRECORD *row, *rec;
LPCWSTR signature, guid;
BOOL sigpresent = TRUE;
@@ -252,7 +235,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU
*appValue = NULL;
- row = MSI_QueryGetRecord(package->db, query, sig->Name);
+ row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `CompLocator` WHERE `Signature_` = '%s'", sig->Name);
if (!row)
{
TRACE("failed to query CompLocator for %s\n", debugstr_w(sig->Name));
@@ -263,7 +246,7 @@ static UINT search_components( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATU
guid = MSI_RecordGetString(row, 2);
type = MSI_RecordGetInteger(row, 3);
- rec = MSI_QueryGetRecord(package->db, sigquery, signature);
+ rec = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Signature` WHERE `Signature` = '%s'", signature);
if (!rec)
sigpresent = FALSE;
@@ -312,9 +295,6 @@ done:
static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR **appValue )
{
- static const WCHAR dwordFmt[] = { '#','%','d','\0' };
- static const WCHAR binPre[] = { '#','x','\0' };
- static const WCHAR binFmt[] = { '%','0','2','X','\0' };
LPWSTR ptr;
DWORD i;
@@ -339,7 +319,7 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
* char if needed
*/
*appValue = msi_alloc(10 * sizeof(WCHAR));
- swprintf(*appValue, 10, dwordFmt, *(const DWORD *)value);
+ swprintf(*appValue, 10, L"#%d", *(const DWORD *)value);
break;
case REG_EXPAND_SZ:
sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0);
@@ -349,10 +329,10 @@ static void convert_reg_value( DWORD regType, const BYTE *value, DWORD sz, WCHAR
case REG_BINARY:
/* #x<nibbles>\0 */
*appValue = msi_alloc((sz * 2 + 3) * sizeof(WCHAR));
- lstrcpyW(*appValue, binPre);
- ptr = *appValue + lstrlenW(binPre);
+ lstrcpyW(*appValue, L"#x");
+ ptr = *appValue + lstrlenW(L"#x");
for (i = 0; i < sz; i++, ptr += 2)
- swprintf(ptr, 3, binFmt, value[i]);
+ swprintf(ptr, 3, L"%02X", value[i]);
break;
default:
WARN("unimplemented for values of type %d\n", regType);
@@ -364,10 +344,6 @@ static UINT search_directory( MSIPACKAGE *, MSISIGNATURE *, const WCHAR *, int,
static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'R','e','g','L','o','c','a','t','o','r',' ','W','H','E','R','E',' ',
- 'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0};
const WCHAR *keyPath, *valueName;
WCHAR *deformatted = NULL, *ptr = NULL, *end;
int root, type;
@@ -382,7 +358,7 @@ static UINT search_reg( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
*appValue = NULL;
- row = MSI_QueryGetRecord( package->db, query, sig->Name );
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `RegLocator` WHERE `Signature_` = '%s'", sig->Name );
if (!row)
{
TRACE("failed to query RegLocator for %s\n", debugstr_w(sig->Name));
@@ -519,12 +495,6 @@ static LPWSTR get_ini_field(LPWSTR buf, int field)
static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
{
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ',
- 'I','n','i','L','o','c','a','t','o','r',' ',
- 'w','h','e','r','e',' ',
- 'S','i','g','n','a','t','u','r','e','_',' ','=',' ','\'','%','s','\'',0};
MSIRECORD *row;
LPWSTR fileName, section, key;
int field, type;
@@ -534,7 +504,7 @@ static UINT search_ini( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
*appValue = NULL;
- row = MSI_QueryGetRecord( package->db, query, sig->Name );
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `IniLocator` WHERE `Signature_` = '%s'", sig->Name );
if (!row)
{
TRACE("failed to query IniLocator for %s\n", debugstr_w(sig->Name));
@@ -657,7 +627,7 @@ static BOOL match_languages( const void *version, const WCHAR *languages )
LANGID *ids;
if (!languages || !languages[0]) return TRUE;
- if (!VerQueryValueW( version, szLangResource, (void **)&lang, &len )) return FALSE;
+ if (!VerQueryValueW( version, L"\\VarFileInfo\\Translation", (void **)&lang, &len )) return FALSE;
if (!(ids = parse_languages( languages, &num_ids ))) return FALSE;
for (i = 0; i < num_ids; i++)
@@ -694,7 +664,7 @@ static UINT file_version_matches( MSIPACKAGE *package, const MSISIGNATURE *sig,
if (!(version = msi_alloc( size ))) return ERROR_OUTOFMEMORY;
if (msi_get_file_version_info( package, filePath, size, version ))
- VerQueryValueW( version, szBackSlash, (void **)&info, &len );
+ VerQueryValueW( version, L"\\", (void **)&info, &len );
if (info)
{
@@ -788,7 +758,6 @@ static UINT file_matches_sig( MSIPACKAGE *package, const MSISIGNATURE *sig, cons
static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig, const WCHAR *dir,
int depth )
{
- static const WCHAR starDotStarW[] = { '*','.','*',0 };
HANDLE hFind;
WIN32_FIND_DATAW findData;
UINT rc = ERROR_SUCCESS;
@@ -807,7 +776,7 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
* here. Add two because we might need to add a backslash if the dir name
* isn't backslash-terminated.
*/
- len = dirLen + max(fileLen, lstrlenW(starDotStarW)) + 2;
+ len = dirLen + max(fileLen, lstrlenW(L"*.*")) + 2;
buf = msi_alloc(len * sizeof(WCHAR));
if (!buf)
return ERROR_OUTOFMEMORY;
@@ -837,14 +806,14 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
{
lstrcpyW(buf, dir);
PathAddBackslashW(buf);
- lstrcatW(buf, starDotStarW);
+ lstrcatW(buf, L"*.*");
hFind = msi_find_first_file( package, buf, &findData );
if (hFind != INVALID_HANDLE_VALUE)
{
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
- wcscmp( findData.cFileName, szDot ) &&
- wcscmp( findData.cFileName, szDotDot ))
+ wcscmp( findData.cFileName, L"." ) &&
+ wcscmp( findData.cFileName, L".." ))
{
lstrcpyW(subpath, dir);
PathAppendW(subpath, findData.cFileName);
@@ -853,8 +822,8 @@ static UINT recurse_search_directory( MSIPACKAGE *package, WCHAR **appValue, MSI
while (rc == ERROR_SUCCESS && !*appValue && msi_find_next_file( package, hFind, &findData ))
{
- if (!wcscmp( findData.cFileName, szDot ) ||
- !wcscmp( findData.cFileName, szDotDot ))
+ if (!wcscmp( findData.cFileName, L"." ) ||
+ !wcscmp( findData.cFileName, L".." ))
continue;
lstrcpyW(subpath, dir);
@@ -966,12 +935,6 @@ static UINT search_sig_name( MSIPACKAGE *, const WCHAR *, MSISIGNATURE *, WCHAR
static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig )
{
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ',
- 'D','r','L','o','c','a','t','o','r',' ',
- 'w','h','e','r','e',' ',
- 'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0};
LPWSTR parent = NULL;
LPCWSTR parentName;
WCHAR path[MAX_PATH];
@@ -985,7 +948,7 @@ static UINT search_dr( MSIPACKAGE *package, WCHAR **appValue, MSISIGNATURE *sig
*appValue = NULL;
- row = MSI_QueryGetRecord( package->db, query, sig->Name );
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `DrLocator` WHERE `Signature_` = '%s'", sig->Name );
if (!row)
{
TRACE("failed to query DrLocator for %s\n", debugstr_w(sig->Name));
@@ -1087,7 +1050,7 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
if (value)
{
r = msi_set_property( package->db, propName, value, -1 );
- if (r == ERROR_SUCCESS && !wcscmp( propName, szSourceDir ))
+ if (r == ERROR_SUCCESS && !wcscmp( propName, L"SourceDir" ))
msi_reset_source_folders( package );
msi_free(value);
@@ -1105,21 +1068,18 @@ static UINT ITERATE_AppSearch(MSIRECORD *row, LPVOID param)
UINT ACTION_AppSearch(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'A','p','p','S','e','a','r','c','h',0};
MSIQUERY *view;
UINT r;
- if (msi_action_is_unique(package, szAppSearch))
+ if (msi_action_is_unique(package, L"AppSearch"))
{
TRACE("Skipping AppSearch action: already done in UI sequence\n");
return ERROR_SUCCESS;
}
else
- msi_register_unique_action(package, szAppSearch);
+ msi_register_unique_action(package, L"AppSearch");
- r = MSI_OpenQuery( package->db, &view, query );
+ r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `AppSearch`" );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -1136,8 +1096,6 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
MSISIGNATURE sig;
UINT r = ERROR_SUCCESS;
- static const WCHAR success[] = {'C','C','P','_','S','u','c','c','e','s','s',0};
-
signature = MSI_RecordGetString(row, 1);
TRACE("%s\n", debugstr_w(signature));
@@ -1146,7 +1104,7 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
if (value)
{
TRACE("Found signature %s\n", debugstr_w(signature));
- msi_set_property( package->db, success, szOne, -1 );
+ msi_set_property( package->db, L"CCP_Success", L"1", -1 );
msi_free(value);
r = ERROR_NO_MORE_ITEMS;
}
@@ -1157,21 +1115,18 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
UINT ACTION_CCPSearch(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- 'C','C','P','S','e','a','r','c','h',0};
MSIQUERY *view;
UINT r;
- if (msi_action_is_unique(package, szCCPSearch))
+ if (msi_action_is_unique(package, L"CCPSearch"))
{
TRACE("Skipping AppSearch action: already done in UI sequence\n");
return ERROR_SUCCESS;
}
else
- msi_register_unique_action(package, szCCPSearch);
+ msi_register_unique_action(package, L"CCPSearch");
- r = MSI_OpenQuery(package->db, &view, query);
+ r = MSI_OpenQuery(package->db, &view, L"SELECT * FROM `CCPSearch`");
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
diff --git a/dlls/msi/assembly.c b/dlls/msi/assembly.c
index bd694333d2a..1007979827a 100644
--- a/dlls/msi/assembly.c
+++ b/dlls/msi/assembly.c
@@ -32,17 +32,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static BOOL load_fusion_dlls( MSIPACKAGE *package )
{
- static const WCHAR szFusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
- static const WCHAR szMscoree[] = {'\\','m','s','c','o','r','e','e','.','d','l','l',0};
- static const WCHAR szVersion10[] = {'v','1','.','0','.','3','7','0','5',0};
- static const WCHAR szVersion11[] = {'v','1','.','1','.','4','3','2','2',0};
- static const WCHAR szVersion20[] = {'v','2','.','0','.','5','0','7','2','7',0};
- static const WCHAR szVersion40[] = {'v','4','.','0','.','3','0','3','1','9',0};
HRESULT (WINAPI *pLoadLibraryShim)( const WCHAR *, const WCHAR *, void *, HMODULE * );
WCHAR path[MAX_PATH];
DWORD len = GetSystemDirectoryW( path, MAX_PATH );
- lstrcpyW( path + len, szMscoree );
+ lstrcpyW( path + len, L"\\mscoree.dll" );
if (package->hmscoree || !(package->hmscoree = LoadLibraryW( path ))) return TRUE;
if (!(pLoadLibraryShim = (void *)GetProcAddress( package->hmscoree, "LoadLibraryShim" )))
{
@@ -51,10 +45,10 @@ static BOOL load_fusion_dlls( MSIPACKAGE *package )
return TRUE;
}
- pLoadLibraryShim( szFusion, szVersion10, NULL, &package->hfusion10 );
- pLoadLibraryShim( szFusion, szVersion11, NULL, &package->hfusion11 );
- pLoadLibraryShim( szFusion, szVersion20, NULL, &package->hfusion20 );
- pLoadLibraryShim( szFusion, szVersion40, NULL, &package->hfusion40 );
+ pLoadLibraryShim( L"fusion.dll", L"v1.0.3705", NULL, &package->hfusion10 );
+ pLoadLibraryShim( L"fusion.dll", L"v1.1.4322", NULL, &package->hfusion11 );
+ pLoadLibraryShim( L"fusion.dll", L"v2.0.50727", NULL, &package->hfusion20 );
+ pLoadLibraryShim( L"fusion.dll", L"v4.0.30319", NULL, &package->hfusion40 );
return TRUE;
}
@@ -129,16 +123,11 @@ void msi_destroy_assembly_caches( MSIPACKAGE *package )
static MSIRECORD *get_assembly_record( MSIPACKAGE *package, const WCHAR *comp )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','M','s','i','A','s','s','e','m','b','l','y','`',' ',
- 'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`',
- ' ','=',' ','\'','%','s','\'',0};
MSIQUERY *view;
MSIRECORD *rec;
UINT r;
- r = MSI_OpenQuery( package->db, &view, query, comp );
+ r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `MsiAssembly` WHERE `Component_` = '%s'", comp );
if (r != ERROR_SUCCESS)
return NULL;
@@ -170,36 +159,28 @@ struct assembly_name
static UINT get_assembly_name_attribute( MSIRECORD *rec, LPVOID param )
{
- static const WCHAR fmtW[] = {'%','s','=','"','%','s','"',0};
- static const WCHAR nameW[] = {'n','a','m','e',0};
struct assembly_name *name = param;
const WCHAR *attr = MSI_RecordGetString( rec, 2 );
const WCHAR *value = MSI_RecordGetString( rec, 3 );
- int len = lstrlenW( fmtW ) + lstrlenW( attr ) + lstrlenW( value );
+ int len = lstrlenW( L"%s=\"%s\"" ) + lstrlenW( attr ) + lstrlenW( value );
if (!(name->attrs[name->index] = msi_alloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY;
- if (!wcsicmp( attr, nameW )) lstrcpyW( name->attrs[name->index++], value );
- else swprintf( name->attrs[name->index++], len, fmtW, attr, value );
+ if (!wcsicmp( attr, L"name" )) lstrcpyW( name->attrs[name->index++], value );
+ else swprintf( name->attrs[name->index++], len, L"%s=\"%s\"", attr, value );
return ERROR_SUCCESS;
}
static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSIASSEMBLY *assembly )
{
- static const WCHAR commaW[] = {',',0};
- static const WCHAR queryW[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','M','s','i','A','s','s','e','m','b','l','y','N','a','m','e','`',' ',
- 'W','H','E','R','E',' ','`','C','o','m','p','o','n','e','n','t','_','`',
- ' ','=',' ','\'','%','s','\'',0};
struct assembly_name name;
WCHAR *display_name = NULL;
MSIQUERY *view;
UINT i, r;
int len;
- r = MSI_OpenQuery( db, &view, queryW, comp );
+ r = MSI_OpenQuery( db, &view, L"SELECT * FROM `MsiAssemblyName` WHERE `Component_` = '%s'", comp );
if (r != ERROR_SUCCESS)
return NULL;
@@ -224,7 +205,7 @@ static WCHAR *get_assembly_display_name( MSIDATABASE *db, const WCHAR *comp, MSI
for (i = 0; i < name.count; i++)
{
lstrcatW( display_name, name.attrs[i] );
- if (i < name.count - 1) lstrcatW( display_name, commaW );
+ if (i < name.count - 1) lstrcatW( display_name, L"," );
}
}
@@ -320,23 +301,17 @@ IAssemblyEnum *msi_create_assembly_enum( MSIPACKAGE *package, const WCHAR *displ
return ret;
}
-static const WCHAR clr_version_v10[] = {'v','1','.','0','.','3','7','0','5',0};
-static const WCHAR clr_version_v11[] = {'v','1','.','1','.','4','3','2','2',0};
-static const WCHAR clr_version_v20[] = {'v','2','.','0','.','5','0','7','2','7',0};
-static const WCHAR clr_version_v40[] = {'v','4','.','0','.','3','0','3','1','9',0};
-static const WCHAR clr_version_unknown[] = {'u','n','k','n','o','w','n',0};
-
static const WCHAR *clr_version[] =
{
- clr_version_v10,
- clr_version_v11,
- clr_version_v20,
- clr_version_v40
+ L"v1.0.3705",
+ L"v1.2.4322",
+ L"v2.0.50727",
+ L"v4.0.30319"
};
static const WCHAR *get_clr_version_str( enum clr_version version )
{
- if (version >= ARRAY_SIZE( clr_version )) return clr_version_unknown;
+ if (version >= ARRAY_SIZE( clr_version )) return L"unknown";
return clr_version[version];
}
@@ -539,30 +514,20 @@ static WCHAR *build_local_assembly_path( const WCHAR *filename )
static LONG open_assemblies_key( UINT context, BOOL win32, HKEY *hkey )
{
- static const WCHAR path_win32[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',0};
- static const WCHAR path_dotnet[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',0};
- static const WCHAR classes_path_win32[] =
- {'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',0};
- static const WCHAR classes_path_dotnet[] =
- {'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',0};
HKEY root;
const WCHAR *path;
if (context == MSIINSTALLCONTEXT_MACHINE)
{
root = HKEY_CLASSES_ROOT;
- if (win32) path = classes_path_win32;
- else path = classes_path_dotnet;
+ if (win32) path = L"Installer\\Win32Assemblies\\";
+ else path = L"Installer\\Assemblies\\";
}
else
{
root = HKEY_CURRENT_USER;
- if (win32) path = path_win32;
- else path = path_dotnet;
+ if (win32) path = L"Software\\Microsoft\\Installer\\Win32Assemblies\\";
+ else path = L"Software\\Microsoft\\Installer\\Assemblies\\";
}
return RegCreateKeyW( root, path, hkey );
}
@@ -609,33 +574,20 @@ static LONG delete_local_assembly_key( UINT context, BOOL win32, const WCHAR *fi
static LONG open_global_assembly_key( UINT context, BOOL win32, HKEY *hkey )
{
- static const WCHAR path_win32[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',
- 'G','l','o','b','a','l',0};
- static const WCHAR path_dotnet[] =
- {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
- 'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\',
- 'G','l','o','b','a','l',0};
- static const WCHAR classes_path_win32[] =
- {'I','n','s','t','a','l','l','e','r','\\','W','i','n','3','2','A','s','s','e','m','b','l','i','e','s','\\',
- 'G','l','o','b','a','l',0};
- static const WCHAR classes_path_dotnet[] =
- {'I','n','s','t','a','l','l','e','r','\\','A','s','s','e','m','b','l','i','e','s','\\','G','l','o','b','a','l',0};
HKEY root;
const WCHAR *path;
if (context == MSIINSTALLCONTEXT_MACHINE)
{
root = HKEY_CLASSES_ROOT;
- if (win32) path = classes_path_win32;
- else path = classes_path_dotnet;
+ if (win32) path = L"Installer\\Win32Assemblies\\Global";
+ else path = L"Installer\\Assemblies\\Global";
}
else
{
root = HKEY_CURRENT_USER;
- if (win32) path = path_win32;
- else path = path_dotnet;
+ if (win32) path = L"Software\\Microsoft\\Installer\\Win32Assemblies\\Global";
+ else path = L"Software\\Microsoft\\Installer\\Assemblies\\Global";
}
return RegCreateKeyW( root, path, hkey );
}
@@ -645,7 +597,7 @@ UINT ACTION_MsiPublishAssemblies( MSIPACKAGE *package )
MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szMsiPublishAssemblies);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiPublishAssemblies");
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{
@@ -718,7 +670,7 @@ UINT ACTION_MsiUnpublishAssemblies( MSIPACKAGE *package )
MSICOMPONENT *comp;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szMsiUnpublishAssemblies);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"MsiUnpublishAssemblies");
LIST_FOR_EACH_ENTRY(comp, &package->components, MSICOMPONENT, entry)
{
diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c
index 87c7815094a..dc38436e682 100644
--- a/dlls/msi/automation.c
+++ b/dlls/msi/automation.c
@@ -95,8 +95,7 @@ HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
hr = LoadRegTypeLib(&LIBID_WindowsInstaller, 1, 0, LOCALE_NEUTRAL, &lib);
if (FAILED(hr)) {
- static const WCHAR msiserverW[] = {'m','s','i','s','e','r','v','e','r','.','t','l','b',0};
- hr = LoadTypeLib(msiserverW, &lib);
+ hr = LoadTypeLib(L"msiserver.tlb", &lib);
if (FAILED(hr)) {
ERR("Could not load msiserver.tlb\n");
return hr;
@@ -376,8 +375,6 @@ static HRESULT WINAPI AutomationObject_Invoke(
else if (pExcepInfo &&
(hr == DISP_E_PARAMNOTFOUND ||
hr == DISP_E_EXCEPTION)) {
- static const WCHAR szComma[] = { ',',0 };
- static const WCHAR szExceptionSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0};
WCHAR szExceptionDescription[MAX_PATH];
BSTR bstrParamNames[MAX_FUNC_PARAMS];
unsigned namesNo, i;
@@ -395,7 +392,7 @@ static HRESULT WINAPI AutomationObject_Invoke(
{
if (bFirst) bFirst = FALSE;
else {
- lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], szComma);
+ lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], L",");
}
lstrcpyW(&szExceptionDescription[lstrlenW(szExceptionDescription)], bstrParamNames[i]);
SysFreeString(bstrParamNames[i]);
@@ -403,7 +400,7 @@ static HRESULT WINAPI AutomationObject_Invoke(
memset(pExcepInfo, 0, sizeof(EXCEPINFO));
pExcepInfo->wCode = 1000;
- pExcepInfo->bstrSource = SysAllocString(szExceptionSource);
+ pExcepInfo->bstrSource = SysAllocString(L"Msi API Error");
pExcepInfo->bstrDescription = SysAllocString(szExceptionDescription);
hr = DISP_E_EXCEPTION;
}
@@ -1599,8 +1596,6 @@ static HRESULT session_invoke(
* registry value type. Used by Installer::RegistryValue. */
static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYTE lpData, DWORD dwSize)
{
- static const WCHAR szREG_BINARY[] = { '(','R','E','G','_','B','I','N','A','R','Y',')',0 };
- static const WCHAR szREG_[] = { '(','R','E','G','_','?','?',')',0 };
WCHAR *szString = (WCHAR *)lpData;
LPWSTR szNewString = NULL;
DWORD dwNewSize = 0;
@@ -1642,12 +1637,12 @@ static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYT
case REG_QWORD:
V_VT(pVarResult) = VT_BSTR;
- V_BSTR(pVarResult) = SysAllocString(szREG_); /* Weird string, don't know why native returns it */
+ V_BSTR(pVarResult) = SysAllocString(L"(REG_\?\?)"); /* Weird string, don't know why native returns it */
break;
case REG_BINARY:
V_VT(pVarResult) = VT_BSTR;
- V_BSTR(pVarResult) = SysAllocString(szREG_BINARY);
+ V_BSTR(pVarResult) = SysAllocString(L"(REG_BINARY)");
break;
case REG_NONE:
@@ -1950,9 +1945,6 @@ static HRESULT InstallerImpl_Version(WORD wFlags,
DLLVERSIONINFO verinfo;
WCHAR version[MAX_PATH];
- static const WCHAR format[] = {
- '%','d','.','%','d','.','%','d','.','%','d',0};
-
if (!(wFlags & DISPATCH_PROPERTYGET))
return DISP_E_MEMBERNOTFOUND;
@@ -1961,7 +1953,7 @@ static HRESULT InstallerImpl_Version(WORD wFlags,
if (FAILED(hr))
return hr;
- swprintf(version, ARRAY_SIZE(version), format, verinfo.dwMajorVersion, verinfo.dwMinorVersion,
+ swprintf(version, ARRAY_SIZE(version), L"%d.%d.%d.%d", verinfo.dwMajorVersion, verinfo.dwMinorVersion,
verinfo.dwBuildNumber, verinfo.dwPlatformID);
V_VT(pVarResult) = VT_BSTR;
diff --git a/dlls/msi/cond.y b/dlls/msi/cond.y
index 1a79de31bf8..636999a104f 100644
--- a/dlls/msi/cond.y
+++ b/dlls/msi/cond.y
@@ -144,7 +144,7 @@ static void value_free( struct value val )
%%
condition:
- expression
+ expression
{
COND_input* cond = (COND_input*) info;
cond->result = $1;
@@ -157,7 +157,7 @@ condition:
;
expression:
- boolean_term
+ boolean_term
{
$$ = $1;
}
@@ -318,7 +318,7 @@ value:
{
COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
-
+
if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{
$$.type = VALUE_LITERAL;
@@ -335,7 +335,7 @@ value:
{
COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
-
+
if(MSI_GetComponentStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{
$$.type = VALUE_LITERAL;
@@ -352,7 +352,7 @@ value:
{
COND_input* cond = (COND_input*) info;
INSTALLSTATE install, action;
-
+
if (MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{
$$.type = VALUE_LITERAL;
@@ -369,7 +369,7 @@ value:
{
COND_input* cond = (COND_input*) info;
INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN;
-
+
if(MSI_GetFeatureStateW(cond->package, $2, &install, &action ) != ERROR_SUCCESS)
{
$$.type = VALUE_LITERAL;
@@ -501,8 +501,8 @@ static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert )
return compare_substring( a, operator, b );
/* null and empty string are equivalent */
- if (!a) a = szEmpty;
- if (!b) b = szEmpty;
+ if (!a) a = L"";
+ if (!b) b = L"";
if (convert && str_is_number(a) && str_is_number(b))
return compare_int( wcstol(a, NULL, 10), operator, wcstol(b, NULL, 10) );
@@ -581,7 +581,7 @@ static INT compare_int( INT a, INT operator, INT b )
static int COND_IsIdent( WCHAR x )
{
- return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' )
+ return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' )
|| ( x == '#' ) || (x == '.') );
}
@@ -591,24 +591,24 @@ static int COND_GetOperator( COND_input *cond )
const WCHAR str[4];
int id;
} table[] = {
- { {'~','<','=',0}, COND_ILE },
- { {'~','>','<',0}, COND_ISS },
- { {'~','>','>',0}, COND_IRHS },
- { {'~','<','>',0}, COND_INE },
- { {'~','>','=',0}, COND_IGE },
- { {'~','<','<',0}, COND_ILHS },
- { {'~','=',0}, COND_IEQ },
- { {'~','<',0}, COND_ILT },
- { {'~','>',0}, COND_IGT },
- { {'>','=',0}, COND_GE },
- { {'>','<',0}, COND_SS },
- { {'<','<',0}, COND_LHS },
- { {'<','>',0}, COND_NE },
- { {'<','=',0}, COND_LE },
- { {'>','>',0}, COND_RHS },
- { {'>',0}, COND_GT },
- { {'<',0}, COND_LT },
- { {0}, 0 }
+ { L"~<=", COND_ILE },
+ { L"~><", COND_ISS },
+ { L"~>>", COND_IRHS },
+ { L"~<>", COND_INE },
+ { L"~>=", COND_IGE },
+ { L"~<<", COND_ILHS },
+ { L"~=", COND_IEQ },
+ { L"~<", COND_ILT },
+ { L"~>", COND_IGT },
+ { L">=", COND_GE },
+ { L"><", COND_SS },
+ { L"<<", COND_LHS },
+ { L"<>", COND_NE },
+ { L"<=", COND_LE },
+ { L">>", COND_RHS },
+ { L">", COND_GT },
+ { L"<", COND_LT },
+ { L"", 0 }
};
LPCWSTR p = &cond->str[cond->n];
int i = 0, len;
@@ -672,31 +672,24 @@ static int COND_GetOne( struct cond_str *str, COND_input *cond )
}
else if( COND_IsAlpha( ch ) )
{
- static const WCHAR szNot[] = {'N','O','T',0};
- static const WCHAR szAnd[] = {'A','N','D',0};
- static const WCHAR szXor[] = {'X','O','R',0};
- static const WCHAR szEqv[] = {'E','Q','V',0};
- static const WCHAR szImp[] = {'I','M','P',0};
- static const WCHAR szOr[] = {'O','R',0};
-
while( COND_IsIdent( str->data[len] ) )
len++;
rc = COND_IDENT;
if ( len == 3 )
{
- if ( !wcsnicmp( str->data, szNot, len ) )
+ if ( !wcsnicmp( str->data, L"NOT", len ) )
rc = COND_NOT;
- else if( !wcsnicmp( str->data, szAnd, len ) )
+ else if( !wcsnicmp( str->data, L"AND", len ) )
rc = COND_AND;
- else if( !wcsnicmp( str->data, szXor, len ) )
+ else if( !wcsnicmp( str->data, L"XOR", len ) )
rc = COND_XOR;
- else if( !wcsnicmp( str->data, szEqv, len ) )
+ else if( !wcsnicmp( str->data, L"EQV", len ) )
rc = COND_EQV;
- else if( !wcsnicmp( str->data, szImp, len ) )
+ else if( !wcsnicmp( str->data, L"IMP", len ) )
rc = COND_IMP;
}
- else if( (len == 2) && !wcsnicmp( str->data, szOr, len ) )
+ else if( (len == 2) && !wcsnicmp( str->data, L"OR", len ) )
rc = COND_OR;
}
else if( COND_IsNumber( ch ) )
@@ -725,7 +718,7 @@ static int cond_lex( void *COND_lval, COND_input *cond )
do {
rc = COND_GetOne( str, cond );
} while (rc == COND_SPACE);
-
+
return rc;
}
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index e2379424878..508d2edb5cf 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -175,37 +175,32 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
LPWSTR deferred;
DWORD len;
- static const WCHAR format[] = {
- '[','%','s','<','=','>','%','s','<','=','>','%','s',']','%','s',0
- };
-
if (!actiondata)
return strdupW(action);
len = lstrlenW(action) + lstrlenW(actiondata) +
lstrlenW(usersid) + lstrlenW(prodcode) +
- lstrlenW(format) - 7;
+ lstrlenW(L"[%s<=>%s<=>%s]%s") - 7;
deferred = msi_alloc(len * sizeof(WCHAR));
- swprintf(deferred, len, format, actiondata, usersid, prodcode, action);
+ swprintf(deferred, len, L"[%s<=>%s<=>%s]%s", actiondata, usersid, prodcode, action);
return deferred;
}
static void set_deferred_action_props( MSIPACKAGE *package, const WCHAR *deferred_data )
{
- static const WCHAR sep[] = {'<','=','>',0};
const WCHAR *end, *beg = deferred_data + 1;
- end = wcsstr(beg, sep);
- msi_set_property( package->db, szCustomActionData, beg, end - beg );
+ end = wcsstr(beg, L"<=>");
+ msi_set_property( package->db, L"CustomActionData", beg, end - beg );
beg = end + 3;
- end = wcsstr(beg, sep);
- msi_set_property( package->db, szUserSID, beg, end - beg );
+ end = wcsstr(beg, L"<=>");
+ msi_set_property( package->db, L"UserSID", beg, end - beg );
beg = end + 3;
end = wcschr(beg, ']');
- msi_set_property( package->db, szProductCode, beg, end - beg );
+ msi_set_property( package->db, L"ProductCode", beg, end - beg );
}
WCHAR *msi_create_temp_file( MSIDATABASE *db )
@@ -217,7 +212,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db )
WCHAR tmp[MAX_PATH];
UINT len = ARRAY_SIZE( tmp );
- if (msi_get_property( db, szTempFolder, tmp, &len ) ||
+ if (msi_get_property( db, L"TempFolder", tmp, &len ) ||
GetFileAttributesW( tmp ) != FILE_ATTRIBUTE_DIRECTORY)
{
GetTempPathW( MAX_PATH, tmp );
@@ -227,7 +222,7 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db )
if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
{
- if (!GetTempFileNameW( db->tempfolder, szMsi, 0, ret ))
+ if (!GetTempFileNameW( db->tempfolder, L"msi", 0, ret ))
{
msi_free( ret );
return NULL;
@@ -239,10 +234,6 @@ WCHAR *msi_create_temp_file( MSIDATABASE *db )
static MSIBINARY *create_temp_binary(MSIPACKAGE *package, LPCWSTR source)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','B','i' ,'n','a','r','y','`',' ','W','H','E','R','E',' ',
- '`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0};
MSIRECORD *row;
MSIBINARY *binary = NULL;
HANDLE file;
@@ -253,7 +244,7 @@ static MSIBINARY *create_temp_binary(MSIPACKAGE *package, LPCWSTR source)
if (!(tmpfile = msi_create_temp_file( package->db ))) return NULL;
- if (!(row = MSI_QueryGetRecord( package->db, query, source ))) goto error;
+ if (!(row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", source ))) goto error;
if (!(binary = msi_alloc_zero( sizeof(MSIBINARY) ))) goto error;
file = CreateFileW( tmpfile, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
@@ -473,9 +464,6 @@ static void handle_msi_break(LPCSTR target)
DebugBreak();
}
-static WCHAR ncalrpcW[] = {'n','c','a','l','r','p','c',0};
-static WCHAR endpoint_fmtW[] = {'m','s','i','%','x',0};
-
#ifdef __i386__
/* wrapper for apps that don't declare the thread function correctly */
extern UINT custom_proc_wrapper( MsiCustomActionEntryPoint entry, MSIHANDLE hinst );
@@ -518,8 +506,8 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
{
WCHAR endpoint[12];
- swprintf(endpoint, ARRAY_SIZE(endpoint), endpoint_fmtW, client_pid);
- status = RpcStringBindingComposeW(NULL, ncalrpcW, NULL, endpoint, NULL, &binding_str);
+ swprintf(endpoint, ARRAY_SIZE(endpoint), L"msi%x", client_pid);
+ status = RpcStringBindingComposeW(NULL, (WCHAR *)L"ncalrpc", NULL, endpoint, NULL, &binding_str);
if (status != RPC_S_OK)
{
ERR("RpcStringBindingCompose failed: %#x\n", status);
@@ -588,10 +576,6 @@ UINT CDECL __wine_msi_call_dll_function(DWORD client_pid, const GUID *guid)
static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
{
- static const WCHAR pipe_name[] = {'\\','\\','.','\\','p','i','p','e','\\','m','s','i','c','a','_','%','x','_','%','d',0};
- static const WCHAR msiexecW[] = {'\\','m','s','i','e','x','e','c','.','e','x','e',0};
- static const WCHAR argsW[] = {'%','s',' ','-','E','m','b','e','d','d','i','n','g',' ','%','d',0};
-
WCHAR path[MAX_PATH], cmdline[MAX_PATH + 23];
PROCESS_INFORMATION pi = {0};
STARTUPINFOW si = {0};
@@ -604,7 +588,7 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
(arch == SCS_64BIT_BINARY && package->custom_server_64_process))
return ERROR_SUCCESS;
- swprintf(buffer, ARRAY_SIZE(buffer), pipe_name,
+ swprintf(buffer, ARRAY_SIZE(buffer), L"\\\\.\\pipe\\msica_%x_%d",
GetCurrentProcessId(), arch == SCS_32BIT_BINARY ? 32 : 64);
pipe = CreateNamedPipeW(buffer, PIPE_ACCESS_DUPLEX, 0, 1, sizeof(DWORD64),
sizeof(GUID), 0, NULL);
@@ -615,11 +599,11 @@ static DWORD custom_start_server(MSIPACKAGE *package, DWORD arch)
wow64 = FALSE;
if ((sizeof(void *) == 8 || wow64) && arch == SCS_32BIT_BINARY)
- GetSystemWow64DirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW));
+ GetSystemWow64DirectoryW(path, MAX_PATH - ARRAY_SIZE(L"\\msiexec.exe"));
else
- GetSystemDirectoryW(path, MAX_PATH - ARRAY_SIZE(msiexecW));
- lstrcatW(path, msiexecW);
- swprintf(cmdline, ARRAY_SIZE(cmdline), argsW, path, GetCurrentProcessId());
+ GetSystemDirectoryW(path, MAX_PATH - ARRAY_SIZE(L"\\msiexec.exe"));
+ lstrcatW(path, L"\\msiexec.exe");
+ swprintf(cmdline, ARRAY_SIZE(cmdline), L"%s -Embedding %d", path, GetCurrentProcessId());
if (wow64 && arch == SCS_64BIT_BINARY)
{
@@ -744,8 +728,8 @@ static msi_custom_action_info *do_msidbCustomActionTypeDll(
{
WCHAR endpoint[12];
- swprintf(endpoint, ARRAY_SIZE(endpoint), endpoint_fmtW, GetCurrentProcessId());
- status = RpcServerUseProtseqEpW(ncalrpcW, RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
+ swprintf(endpoint, ARRAY_SIZE(endpoint), L"msi%x", GetCurrentProcessId());
+ status = RpcServerUseProtseqEpW((WCHAR *)L"ncalrpc", RPC_C_PROTSEQ_MAX_REQS_DEFAULT,
endpoint, NULL);
if (status != RPC_S_OK)
{
@@ -797,7 +781,6 @@ static UINT HANDLE_CustomType1( MSIPACKAGE *package, const WCHAR *source, const
static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir )
{
- static const WCHAR dotexeW[] = {'.','e','x','e',0};
STARTUPINFOW si;
PROCESS_INFORMATION info;
WCHAR *exe = NULL, *cmd = NULL, *p;
@@ -809,12 +792,12 @@ static HANDLE execute_command( const WCHAR *app, WCHAR *arg, const WCHAR *dir )
DWORD len_exe;
if (!(exe = msi_alloc( MAX_PATH * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
- len_exe = SearchPathW( NULL, app, dotexeW, MAX_PATH, exe, NULL );
+ len_exe = SearchPathW( NULL, app, L".exe", MAX_PATH, exe, NULL );
if (len_exe >= MAX_PATH)
{
msi_free( exe );
if (!(exe = msi_alloc( len_exe * sizeof(WCHAR) ))) return INVALID_HANDLE_VALUE;
- len_exe = SearchPathW( NULL, app, dotexeW, len_exe, exe, NULL );
+ len_exe = SearchPathW( NULL, app, L".exe", len_exe, exe, NULL );
}
if (!len_exe)
{
@@ -876,7 +859,7 @@ static UINT HANDLE_CustomType2( MSIPACKAGE *package, const WCHAR *source, const
deformat_string( package, target, &arg );
TRACE("exe %s arg %s\n", debugstr_w(binary->tmpfile), debugstr_w(arg));
- handle = execute_command( binary->tmpfile, arg, szCRoot );
+ handle = execute_command( binary->tmpfile, arg, L"C:\\" );
msi_free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
@@ -913,7 +896,7 @@ static UINT HANDLE_CustomType18( MSIPACKAGE *package, const WCHAR *source, const
deformat_string( package, target, &arg );
TRACE("exe %s arg %s\n", debugstr_w(file->TargetPath), debugstr_w(arg));
- handle = execute_command( file->TargetPath, arg, szCRoot );
+ handle = execute_command( file->TargetPath, arg, L"C:\\" );
msi_free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
return wait_process_handle( package, type, handle, action );
@@ -922,19 +905,13 @@ static UINT HANDLE_CustomType18( MSIPACKAGE *package, const WCHAR *source, const
static UINT HANDLE_CustomType19( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','`','M','e','s','s','a','g','e','`',' ',
- 'F','R','O','M',' ','`','E','r','r','o','r','`',' ',
- 'W','H','E','R','E',' ','`','E','r','r','o','r','`',' ','=',' ',
- '%','s',0
- };
MSIRECORD *row = 0;
LPWSTR deformated = NULL;
deformat_string( package, target, &deformated );
/* first try treat the error as a number */
- row = MSI_QueryGetRecord( package->db, query, deformated );
+ row = MSI_QueryGetRecord( package->db, L"SELECT `Message` FROM `Error` WHERE `Error` = '%s'", deformated );
if( row )
{
LPCWSTR error = MSI_RecordGetString( row, 1 );
@@ -974,7 +951,7 @@ static UINT HANDLE_CustomType23( MSIPACKAGE *package, const WCHAR *source, const
UINT len_dir, len_source = lstrlenW( source );
HANDLE handle;
- if (!(dir = msi_dup_property( package->db, szOriginalDatabase ))) return ERROR_OUTOFMEMORY;
+ if (!(dir = msi_dup_property( package->db, L"OriginalDatabase" ))) return ERROR_OUTOFMEMORY;
if (!(p = wcsrchr( dir, '\\' )) && !(p = wcsrchr( dir, '/' )))
{
msi_free( dir );
@@ -1091,7 +1068,7 @@ static UINT HANDLE_CustomType50( MSIPACKAGE *package, const WCHAR *source, const
deformat_string( package, target, &arg );
TRACE("exe %s arg %s\n", debugstr_w(exe), debugstr_w(arg));
- handle = execute_command( exe, arg, szCRoot );
+ handle = execute_command( exe, arg, L"C:\\" );
msi_free( exe );
msi_free( arg );
if (handle == INVALID_HANDLE_VALUE) return ERROR_SUCCESS;
@@ -1209,10 +1186,6 @@ static UINT HANDLE_CustomType37_38( MSIPACKAGE *package, const WCHAR *source, co
static UINT HANDLE_CustomType5_6( MSIPACKAGE *package, const WCHAR *source, const WCHAR *target,
INT type, const WCHAR *action )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','B','i' ,'n','a','r','y','`',' ','W','H','E','R','E',' ',
- '`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0};
MSIRECORD *row = NULL;
msi_custom_action_info *info;
CHAR *buffer = NULL;
@@ -1222,7 +1195,7 @@ static UINT HANDLE_CustomType5_6( MSIPACKAGE *package, const WCHAR *source, cons
TRACE("%s %s\n", debugstr_w(source), debugstr_w(target));
- row = MSI_QueryGetRecord(package->db, query, source);
+ row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", source);
if (!row)
return ERROR_FUNCTION_FAILED;
@@ -1354,8 +1327,8 @@ static BOOL action_type_matches_script( UINT type, UINT script )
static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT type )
{
WCHAR *actiondata = msi_dup_property( package->db, action );
- WCHAR *usersid = msi_dup_property( package->db, szUserSID );
- WCHAR *prodcode = msi_dup_property( package->db, szProductCode );
+ WCHAR *usersid = msi_dup_property( package->db, L"UserSID" );
+ WCHAR *prodcode = msi_dup_property( package->db, L"ProductCode" );
WCHAR *deferred = msi_get_deferred_action( action, actiondata, usersid, prodcode );
if (!deferred)
@@ -1390,10 +1363,6 @@ static UINT defer_custom_action( MSIPACKAGE *package, const WCHAR *action, UINT
UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','C','u','s','t','o','m','A','c','t','i','o','n','`',' ','W','H','E','R','E',' ',
- '`','A','c','t','i' ,'o','n','`',' ','=',' ','\'','%','s','\'',0};
UINT rc = ERROR_SUCCESS;
MSIRECORD *row;
UINT type;
@@ -1408,7 +1377,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
action = ptr + 1;
}
- row = MSI_QueryGetRecord( package->db, query, action );
+ row = MSI_QueryGetRecord( package->db, L"SELECT * FROM `CustomAction` WHERE `Action` = '%s'", action );
if (!row)
return ERROR_FUNCTION_NOT_CALLED;
@@ -1449,9 +1418,9 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
if (deferred_data)
set_deferred_action_props(package, deferred_data);
else if (actiondata)
- msi_set_property( package->db, szCustomActionData, actiondata, -1 );
+ msi_set_property( package->db, L"CustomActionData", actiondata, -1 );
else
- msi_set_property( package->db, szCustomActionData, szEmpty, -1 );
+ msi_set_property( package->db, L"CustomActionData", L"", -1 );
msi_free(actiondata);
}
@@ -1516,7 +1485,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
if (!source) break;
len = deformat_string( package, target, &deformated );
rc = msi_set_property( package->db, source, deformated, len );
- if (rc == ERROR_SUCCESS && !wcscmp( source, szSourceDir )) msi_reset_source_folders( package );
+ if (rc == ERROR_SUCCESS && !wcscmp( source, L"SourceDir" )) msi_reset_source_folders( package );
msi_free( deformated );
break;
case 53: /* JScript/VBScript text specified by a property value */
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index f7c70aeead7..c84fd1f6440 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -103,7 +103,6 @@ static VOID MSI_CloseDatabase( MSIOBJECTHDR *arg )
static HRESULT db_initialize( IStorage *stg, const GUID *clsid )
{
- static const WCHAR szTables[] = { '_','T','a','b','l','e','s',0 };
HRESULT hr;
hr = IStorage_SetClass( stg, clsid );
@@ -114,7 +113,7 @@ static HRESULT db_initialize( IStorage *stg, const GUID *clsid )
}
/* create the _Tables stream */
- hr = write_stream_data( stg, szTables, NULL, 0, TRUE );
+ hr = write_stream_data( stg, L"_Tables", NULL, 0, TRUE );
if (FAILED( hr ))
{
WARN("failed to create _Tables stream 0x%08x\n", hr);
@@ -257,7 +256,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
if (!wcschr( save_path, '\\' ))
{
GetCurrentDirectoryW( MAX_PATH, path );
- lstrcatW( path, szBackSlash );
+ lstrcatW( path, L"\\" );
lstrcatW( path, save_path );
}
else
@@ -452,14 +451,12 @@ static LPWSTR msi_build_createsql_prelude(LPWSTR table)
LPWSTR prelude;
DWORD size;
- static const WCHAR create_fmt[] = {'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','%','s','`',' ','(',' ',0};
-
- size = ARRAY_SIZE(create_fmt) + lstrlenW(table) - 2;
+ size = ARRAY_SIZE(L"CREATE TABLE `%s` ( ") + lstrlenW(table) - 2;
prelude = msi_alloc(size * sizeof(WCHAR));
if (!prelude)
return NULL;
- swprintf(prelude, size, create_fmt, table);
+ swprintf(prelude, size, L"CREATE TABLE `%s` ( ", table);
return prelude;
}
@@ -471,15 +468,6 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
WCHAR expanded[128], *ptr;
WCHAR size[10], comma[2], extra[30];
- static const WCHAR column_fmt[] = {'`','%','s','`',' ','%','s','%','s','%','s','%','s',' ',0};
- static const WCHAR size_fmt[] = {'(','%','s',')',0};
- static const WCHAR type_char[] = {'C','H','A','R',0};
- static const WCHAR type_int[] = {'I','N','T',0};
- static const WCHAR type_long[] = {'L','O','N','G',0};
- static const WCHAR type_object[] = {'O','B','J','E','C','T',0};
- static const WCHAR type_notnull[] = {' ','N','O','T',' ','N','U','L','L',0};
- static const WCHAR localizable[] = {' ','L','O','C','A','L','I','Z','A','B','L','E',0};
-
columns = msi_alloc_zero(sql_size * sizeof(WCHAR));
if (!columns)
return NULL;
@@ -501,28 +489,28 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
switch (types[i][0])
{
case 'l':
- lstrcpyW(extra, type_notnull);
+ lstrcpyW(extra, L" NOT NULL");
/* fall through */
case 'L':
- lstrcatW(extra, localizable);
- type = type_char;
- swprintf(size, ARRAY_SIZE(size), size_fmt, ptr);
+ lstrcatW(extra, L" LOCALIZABLE");
+ type = L"CHAR";
+ swprintf(size, ARRAY_SIZE(size), L"(%s)", ptr);
break;
case 's':
- lstrcpyW(extra, type_notnull);
+ lstrcpyW(extra, L" NOT NULL");
/* fall through */
case 'S':
- type = type_char;
- swprintf(size, ARRAY_SIZE(size), size_fmt, ptr);
+ type = L"CHAR";
+ swprintf(size, ARRAY_SIZE(size), L"(%s)", ptr);
break;
case 'i':
- lstrcpyW(extra, type_notnull);
+ lstrcpyW(extra, L" NOT NULL");
/* fall through */
case 'I':
if (len <= 2)
- type = type_int;
+ type = L"INT";
else if (len == 4)
- type = type_long;
+ type = L"LONG";
else
{
WARN("invalid int width %u\n", len);
@@ -531,10 +519,10 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
}
break;
case 'v':
- lstrcpyW(extra, type_notnull);
+ lstrcpyW(extra, L" NOT NULL");
/* fall through */
case 'V':
- type = type_object;
+ type = L"OBJECT";
break;
default:
ERR("Unknown type: %c\n", types[i][0]);
@@ -542,7 +530,7 @@ static LPWSTR msi_build_createsql_columns(LPWSTR *columns_data, LPWSTR *types, D
return NULL;
}
- swprintf(expanded, ARRAY_SIZE(expanded), column_fmt, columns_data[i], type, size, extra, comma);
+ swprintf(expanded, ARRAY_SIZE(expanded), L"`%s` %s%s%s%s ", columns_data[i], type, size, extra, comma);
sql_size += lstrlenW(expanded);
p = msi_realloc(columns, sql_size * sizeof(WCHAR));
@@ -564,11 +552,8 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys)
LPWSTR postlude, keys, ptr;
DWORD size, i;
- static const WCHAR key_fmt[] = {'`','%','s','`',',',' ',0};
- static const WCHAR postlude_fmt[] = {'P','R','I','M','A','R','Y',' ','K','E','Y',' ','%','s',')',0};
-
for (i = 0, size = 1; i < num_keys; i++)
- size += lstrlenW(key_fmt) + lstrlenW(primary_keys[i]) - 2;
+ size += lstrlenW(L"`%s`, ") + lstrlenW(primary_keys[i]) - 2;
keys = msi_alloc(size * sizeof(WCHAR));
if (!keys)
@@ -576,18 +561,18 @@ static LPWSTR msi_build_createsql_postlude(LPWSTR *primary_keys, DWORD num_keys)
for (i = 0, ptr = keys; i < num_keys; i++)
{
- ptr += swprintf(ptr, size - (ptr - keys), key_fmt, primary_keys[i]);
+ ptr += swprintf(ptr, size - (ptr - keys), L"`%s`, ", primary_keys[i]);
}
/* remove final ', ' */
*(ptr - 2) = '\0';
- size = lstrlenW(postlude_fmt) + size - 1;
+ size = lstrlenW(L"PRIMARY KEY %s)") + size - 1;
postlude = msi_alloc(size * sizeof(WCHAR));
if (!postlude)
goto done;
- swprintf(postlude, size, postlude_fmt, keys);
+ swprintf(postlude, size, L"PRIMARY KEY %s)", keys);
done:
msi_free(keys);
@@ -712,12 +697,7 @@ static UINT msi_add_records_to_table(MSIDATABASE *db, LPWSTR *columns, LPWSTR *t
MSIQUERY *view;
MSIRECORD *rec;
- static const WCHAR select[] = {
- 'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','`','%','s','`',0
- };
-
- r = MSI_OpenQuery(db, &view, select, labels[0]);
+ r = MSI_OpenQuery(db, &view, L"SELECT * FROM `%s`", labels[0]);
if (r != ERROR_SUCCESS)
return r;
@@ -753,31 +733,21 @@ done:
static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
{
UINT r;
- DWORD len, i;
- DWORD num_labels, num_types;
- DWORD num_columns, num_records = 0;
- LPWSTR *columns, *types, *labels;
- LPWSTR path, ptr, data;
- LPWSTR **records = NULL;
- LPWSTR **temp_records;
-
- static const WCHAR suminfo[] =
- {'_','S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
- static const WCHAR forcecodepage[] =
- {'_','F','o','r','c','e','C','o','d','e','p','a','g','e',0};
+ DWORD len, i, num_labels, num_types, num_columns, num_records = 0;
+ WCHAR **columns, **types, **labels, *path, *ptr, *data, ***records = NULL, ***temp_records;
TRACE("%p %s %s\n", db, debugstr_w(folder), debugstr_w(file) );
- if( folder == NULL || file == NULL )
+ if (!folder || !file)
return ERROR_INVALID_PARAMETER;
- len = lstrlenW(folder) + lstrlenW(szBackSlash) + lstrlenW(file) + 1;
+ len = lstrlenW(folder) + lstrlenW(L"\\") + lstrlenW(file) + 1;
path = msi_alloc( len * sizeof(WCHAR) );
if (!path)
return ERROR_OUTOFMEMORY;
lstrcpyW( path, folder );
- lstrcatW( path, szBackSlash );
+ lstrcatW( path, L"\\" );
lstrcatW( path, file );
data = msi_read_text_archive( path, &len );
@@ -793,7 +763,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
msi_parse_line( &ptr, &labels, &num_labels, &len );
if (num_columns == 1 && !columns[0][0] && num_labels == 1 && !labels[0][0] &&
- num_types == 2 && !wcscmp( types[1], forcecodepage ))
+ num_types == 2 && !wcscmp( types[1], L"_ForceCodepage" ))
{
r = msi_set_string_table_codepage( db->strings, wcstol( types[0], NULL, 10 ) );
goto done;
@@ -805,7 +775,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
goto done;
}
- records = msi_alloc(sizeof(LPWSTR *));
+ records = msi_alloc(sizeof(WCHAR **));
if (!records)
{
r = ERROR_OUTOFMEMORY;
@@ -818,7 +788,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
msi_parse_line( &ptr, &records[num_records], NULL, &len );
num_records++;
- temp_records = msi_realloc(records, (num_records + 1) * sizeof(LPWSTR *));
+ temp_records = msi_realloc(records, (num_records + 1) * sizeof(WCHAR **));
if (!temp_records)
{
r = ERROR_OUTOFMEMORY;
@@ -827,7 +797,7 @@ static UINT MSI_DatabaseImport(MSIDATABASE *db, LPCWSTR folder, LPCWSTR file)
records = temp_records;
}
- if (!wcscmp(labels[0], suminfo))
+ if (!wcscmp(labels[0], L"_SummaryInformation"))
{
r = msi_add_suminfo( db, records, num_records, num_columns );
if (r != ERROR_SUCCESS)
@@ -862,7 +832,6 @@ done:
msi_free(records[i]);
msi_free(records);
-
return r;
}
@@ -957,7 +926,6 @@ static UINT msi_export_field( HANDLE handle, MSIRECORD *row, UINT field )
static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECORD *row, UINT field, UINT start )
{
- static const WCHAR fmt[] = {'%','s','\\','%','s',0};
WCHAR stream[MAX_STREAM_NAME_LEN + 1], *path;
DWORD sz, read_size, write_size;
char buffer[1024];
@@ -969,11 +937,11 @@ static UINT msi_export_stream( const WCHAR *folder, const WCHAR *table, MSIRECOR
if (r != ERROR_SUCCESS)
return r;
- len = sz + lstrlenW( folder ) + lstrlenW( table ) + ARRAY_SIZE( fmt ) + 1;
+ len = sz + lstrlenW( folder ) + lstrlenW( table ) + ARRAY_SIZE( L"%s\\%s" ) + 1;
if (!(path = msi_alloc( len * sizeof(WCHAR) )))
return ERROR_OUTOFMEMORY;
- len = swprintf( path, len, fmt, folder, table );
+ len = swprintf( path, len, L"%s\\%s", folder, table );
if (!CreateDirectoryW( path, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
{
msi_free( path );
@@ -1078,22 +1046,16 @@ static UINT msi_export_summaryinformation( MSIDATABASE *db, HANDLE handle )
static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder, LPCWSTR file )
{
- static const WCHAR query[] = {
- 's','e','l','e','c','t',' ','*',' ','f','r','o','m',' ','%','s',0 };
- static const WCHAR forcecodepage[] = {
- '_','F','o','r','c','e','C','o','d','e','p','a','g','e',0 };
- static const WCHAR summaryinformation[] = {
- '_','S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0 };
MSIRECORD *rec = NULL;
MSIQUERY *view = NULL;
- LPWSTR filename;
+ WCHAR *filename;
HANDLE handle;
UINT len, r;
TRACE("%p %s %s %s\n", db, debugstr_w(table),
debugstr_w(folder), debugstr_w(file) );
- if( folder == NULL || file == NULL )
+ if (!folder || !file)
return ERROR_INVALID_PARAMETER;
len = lstrlenW(folder) + lstrlenW(file) + 2;
@@ -1102,7 +1064,7 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder,
return ERROR_OUTOFMEMORY;
lstrcpyW( filename, folder );
- lstrcatW( filename, szBackSlash );
+ lstrcatW( filename, L"\\" );
lstrcatW( filename, file );
handle = CreateFileW( filename, GENERIC_READ | GENERIC_WRITE, 0,
@@ -1111,20 +1073,20 @@ static UINT MSI_DatabaseExport( MSIDATABASE *db, LPCWSTR table, LPCWSTR folder,
if (handle == INVALID_HANDLE_VALUE)
return ERROR_FUNCTION_FAILED;
- if (!wcscmp( table, forcecodepage ))
+ if (!wcscmp( table, L"_ForceCodepage" ))
{
UINT codepage = msi_get_string_table_codepage( db->strings );
r = msi_export_forcecodepage( handle, codepage );
goto done;
}
- if (!wcscmp( table, summaryinformation ))
+ if (!wcscmp( table, L"_SummaryInformation" ))
{
r = msi_export_summaryinformation( db, handle );
goto done;
}
- r = MSI_OpenQuery( db, &view, query, table );
+ r = MSI_OpenQuery( db, &view, L"SELECT * FROM %s", table );
if (r == ERROR_SUCCESS)
{
struct row_export_info row_export_info = { handle, folder, table };
@@ -1424,20 +1386,19 @@ static LPWSTR get_key_value(MSIQUERY *view, LPCWSTR key, MSIRECORD *rec)
if (MSI_RecordGetString(rec, i)) /* check record field is a string */
{
/* quote string record fields */
- static const WCHAR szQuote[] = {'\'', 0};
sz += 2;
- val = msi_alloc(sz*sizeof(WCHAR));
+ val = msi_alloc(sz * sizeof(WCHAR));
if (!val)
return NULL;
- lstrcpyW(val, szQuote);
- r = MSI_RecordGetStringW(rec, i, val+1, &sz);
- lstrcpyW(val+1+sz, szQuote);
+ lstrcpyW(val, L"'");
+ r = MSI_RecordGetStringW(rec, i, val + 1, &sz);
+ lstrcpyW(val + 1 + sz, L"'");
}
else
{
/* do not quote integer record fields */
- val = msi_alloc(sz*sizeof(WCHAR));
+ val = msi_alloc(sz * sizeof(WCHAR));
if (!val)
return NULL;
@@ -1463,14 +1424,6 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
MSIRECORD *keys;
UINT r, i, count;
- static const WCHAR keyset[] = {
- '`','%','s','`',' ','=',' ','%','s',' ','A','N','D',' ',0};
- static const WCHAR lastkeyset[] = {
- '`','%','s','`',' ','=',' ','%','s',' ',0};
- static const WCHAR fmt[] = {'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','`','%','s','`',' ',
- 'W','H','E','R','E',' ','%','s',0};
-
r = MSI_DatabaseGetPrimaryKeys(merge, table, &keys);
if (r != ERROR_SUCCESS)
return NULL;
@@ -1487,9 +1440,9 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
val = get_key_value(view, key, rec);
if (i == count)
- setptr = lastkeyset;
+ setptr = L"`%s` = %s ";
else
- setptr = keyset;
+ setptr = L"`%s` = %s AND ";
oldsize = size;
size += lstrlenW(setptr) + lstrlenW(key) + lstrlenW(val) - 4;
@@ -1504,12 +1457,12 @@ static LPWSTR create_diff_row_query(MSIDATABASE *merge, MSIQUERY *view,
msi_free(val);
}
- size = lstrlenW(fmt) + lstrlenW(table) + lstrlenW(clause) + 1;
+ size = lstrlenW(L"SELECT * FROM `%s` WHERE %s") + lstrlenW(table) + lstrlenW(clause) + 1;
query = msi_alloc(size * sizeof(WCHAR));
if (!query)
goto done;
- swprintf(query, size, fmt, table, clause);
+ swprintf(query, size, L"SELECT * FROM `%s` WHERE %s", table, clause);
done:
msi_free(clause);
@@ -1717,9 +1670,6 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta
MERGETABLE *table;
MSIQUERY *mergeview = NULL;
- static const WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','`','%','s','`',0};
-
table = msi_alloc_zero(sizeof(MERGETABLE));
if (!table)
{
@@ -1731,7 +1681,7 @@ static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **pta
if (r != ERROR_SUCCESS)
goto err;
- r = MSI_OpenQuery(db, &mergeview, query, name);
+ r = MSI_OpenQuery(db, &mergeview, L"SELECT * FROM `%s`", name);
if (r != ERROR_SUCCESS)
goto err;
@@ -1768,18 +1718,15 @@ static UINT merge_diff_tables(MSIRECORD *rec, LPVOID param)
LPCWSTR name;
UINT r;
- static const WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ',
- 'F','R','O','M',' ','`','%','s','`',0};
-
name = MSI_RecordGetString(rec, 1);
- r = MSI_OpenQuery(data->merge, &mergeview, query, name);
+ r = MSI_OpenQuery(data->merge, &mergeview, L"SELECT * FROM `%s`", name);
if (r != ERROR_SUCCESS)
goto done;
if (TABLE_Exists(data->db, name))
{
- r = MSI_OpenQuery(data->db, &dbview, query, name);
+ r = MSI_OpenQuery(data->db, &dbview, L"SELECT * FROM `%s`", name);
if (r != ERROR_SUCCESS)
goto done;
@@ -1816,14 +1763,11 @@ done:
static UINT gather_merge_data(MSIDATABASE *db, MSIDATABASE *merge,
struct list *tabledata)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','_','T','a','b','l','e','s','`',0};
MSIQUERY *view;
MERGEDATA data;
UINT r;
- r = MSI_DatabaseOpenViewW(merge, query, &view);
+ r = MSI_DatabaseOpenViewW(merge, L"SELECT * FROM `_Tables`", &view);
if (r != ERROR_SUCCESS)
return r;
@@ -1871,24 +1815,10 @@ static UINT update_merge_errors(MSIDATABASE *db, LPCWSTR error,
UINT r;
MSIQUERY *view;
- static const WCHAR create[] = {
- 'C','R','E','A','T','E',' ','T','A','B','L','E',' ',
- '`','%','s','`',' ','(','`','T','a','b','l','e','`',' ',
- 'C','H','A','R','(','2','5','5',')',' ','N','O','T',' ',
- 'N','U','L','L',',',' ','`','N','u','m','R','o','w','M','e','r','g','e',
- 'C','o','n','f','l','i','c','t','s','`',' ','S','H','O','R','T',' ',
- 'N','O','T',' ','N','U','L','L',' ','P','R','I','M','A','R','Y',' ',
- 'K','E','Y',' ','`','T','a','b','l','e','`',')',0};
- static const WCHAR insert[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ',
- '`','%','s','`',' ','(','`','T','a','b','l','e','`',',',' ',
- '`','N','u','m','R','o','w','M','e','r','g','e',
- 'C','o','n','f','l','i','c','t','s','`',')',' ','V','A','L','U','E','S',
- ' ','(','\'','%','s','\'',',',' ','%','d',')',0};
-
if (!TABLE_Exists(db, error))
{
- r = MSI_OpenQuery(db, &view, create, error);
+ r = MSI_OpenQuery(db, &view, L"CREATE TABLE `%s` (`Table` CHAR(255) NOT NULL, `NumRowMergeConflicts` SHORT "
+ "NOT NULL PRIMARY KEY `Table`)" , error);
if (r != ERROR_SUCCESS)
return r;
@@ -1898,7 +1828,8 @@ static UINT update_merge_errors(MSIDATABASE *db, LPCWSTR error,
return r;
}
- r = MSI_OpenQuery(db, &view, insert, error, table, numconflicts);
+ r = MSI_OpenQuery(db, &view, L"INSERT INTO `%s` (`Table`, `NumRowMergeConflicts`) VALUES ('%s', %d)", error,
+ table, numconflicts);
if (r != ERROR_SUCCESS)
return r;
@@ -1907,8 +1838,7 @@ static UINT update_merge_errors(MSIDATABASE *db, LPCWSTR error,
return r;
}
-UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge,
- LPCWSTR szTableName)
+UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, LPCWSTR szTableName)
{
struct list tabledata = LIST_INIT(tabledata);
struct list *item, *cursor;
@@ -1917,8 +1847,7 @@ UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge,
BOOL conflicts;
UINT r;
- TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge,
- debugstr_w(szTableName));
+ TRACE("(%d, %d, %s)\n", hDatabase, hDatabaseMerge, debugstr_w(szTableName));
if (szTableName && !*szTableName)
return ERROR_INVALID_TABLE;
diff --git a/dlls/msi/delete.c b/dlls/msi/delete.c
index 81bd9d7db2f..c101b56c231 100644
--- a/dlls/msi/delete.c
+++ b/dlls/msi/delete.c
@@ -196,7 +196,7 @@ UINT DELETE_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
dv = msi_alloc_zero( sizeof *dv );
if( !dv )
return ERROR_FUNCTION_FAILED;
-
+
/* fill the structure */
dv->view.ops = &delete_ops;
dv->db = db;
diff --git a/dlls/msi/distinct.c b/dlls/msi/distinct.c
index e102adb3de2..b97b8c90efc 100644
--- a/dlls/msi/distinct.c
+++ b/dlls/msi/distinct.c
@@ -287,7 +287,7 @@ UINT DISTINCT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table )
dv = msi_alloc_zero( sizeof *dv );
if( !dv )
return ERROR_FUNCTION_FAILED;
-
+
/* fill the structure */
dv->view.ops = &distinct_ops;
msiobj_addref( &db->hdr );
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index aba714b317d..61694ee19ae 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -160,7 +160,6 @@ DWORD msi_get_file_version_info( MSIPACKAGE *package, const WCHAR *path, DWORD b
VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *filename )
{
- static const WCHAR name[] = {'\\',0};
VS_FIXEDFILEINFO *ptr, *ret;
DWORD version_size, size;
void *version;
@@ -170,7 +169,7 @@ VS_FIXEDFILEINFO *msi_get_disk_file_version( MSIPACKAGE *package, const WCHAR *f
msi_get_file_version_info( package, filename, version_size, version );
- if (!VerQueryValueW( version, name, (void **)&ptr, &size ))
+ if (!VerQueryValueW( version, L"\\", (void **)&ptr, &size ))
{
msi_free( version );
return NULL;
@@ -267,7 +266,7 @@ static BOOL is_obsoleted_by_patch( MSIPACKAGE *package, MSIFILE *file )
{
if (!list_empty( &package->patches ) && file->disk_id < MSI_INITIAL_MEDIA_TRANSFORM_DISKID)
{
- if (!msi_get_property_int( package->db, szInstalled, 0 )) return FALSE;
+ if (!msi_get_property_int( package->db, L"Installed", 0 )) return FALSE;
return TRUE;
}
if (is_registered_patch_media( package, file->disk_id )) return TRUE;
@@ -442,7 +441,7 @@ static UINT copy_install_file(MSIPACKAGE *package, MSIFILE *file, LPWSTR source)
msi_free( pathW );
return ERROR_OUTOFMEMORY;
}
- if (!GetTempFileNameW( pathW, szMsi, 0, tmpfileW )) tmpfileW[0] = 0;
+ if (!GetTempFileNameW( pathW, L"msi", 0, tmpfileW )) tmpfileW[0] = 0;
msi_free( pathW );
if (msi_copy_file( package, source, tmpfileW, FALSE ) &&
@@ -548,7 +547,7 @@ WCHAR *msi_resolve_file_source( MSIPACKAGE *package, MSIFILE *file )
/*
* ACTION_InstallFiles()
- *
+ *
* For efficiency, this is done in two passes:
* 1) Correct all the TargetPaths and determine what files are to be installed.
* 2) Extract Cabinets and copy files.
@@ -562,7 +561,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
msi_set_sourcedir_props(package, FALSE);
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szInstallFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallFiles");
schedule_install_files(package);
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
@@ -571,7 +570,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
{
BOOL is_global_assembly = msi_is_global_assembly( file->Component );
- msi_file_update_ui( package, file, szInstallFiles );
+ msi_file_update_ui( package, file, L"InstallFiles" );
rc = msi_load_media_info( package, file->Sequence, mi );
if (rc != ERROR_SUCCESS)
@@ -583,7 +582,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
if (file->state != msifs_hashmatch &&
file->state != msifs_skipped &&
- (file->state != msifs_present || !msi_get_property_int( package->db, szInstalled, 0 )) &&
+ (file->state != msifs_present || !msi_get_property_int( package->db, L"Installed", 0 )) &&
(rc = ready_media( package, file->IsCompressed, mi )))
{
ERR("Failed to ready media for %s\n", debugstr_w(file->File));
@@ -790,7 +789,7 @@ UINT ACTION_PatchFiles( MSIPACKAGE *package )
TRACE("%p\n", package);
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szPatchFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"PatchFiles");
mi = msi_alloc_zero( sizeof(MSIMEDIAINFO) );
@@ -1129,7 +1128,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
lstrcpyW(source, sourcedir);
if (source[lstrlenW(source) - 1] != '\\')
- lstrcatW(source, szBackSlash);
+ lstrcatW(source, L"\\");
lstrcatW(source, sourcename);
}
@@ -1167,7 +1166,7 @@ static UINT ITERATE_MoveFiles( MSIRECORD *rec, LPVOID param )
lstrcpyW(dest, destdir);
if (dest[lstrlenW(dest) - 1] != '\\')
- lstrcatW(dest, szBackSlash);
+ lstrcatW(dest, L"\\");
if (destname)
lstrcatW(dest, destname);
@@ -1205,16 +1204,13 @@ done:
UINT ACTION_MoveFiles( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','M','o','v','e','F','i','l','e','`',0};
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szMoveFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"MoveFiles");
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `MoveFile`", &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -1338,16 +1334,13 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0};
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szDuplicateFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"DuplicateFiles");
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `DuplicateFile`", &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -1416,16 +1409,13 @@ static UINT ITERATE_RemoveDuplicateFiles( MSIRECORD *row, LPVOID param )
UINT ACTION_RemoveDuplicateFiles( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','D','u','p','l','i','c','a','t','e','F','i','l','e','`',0};
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveDuplicateFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveDuplicateFiles");
- rc = MSI_DatabaseOpenViewW( package->db, query, &view );
+ rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `DuplicateFile`", &view );
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -1557,18 +1547,15 @@ static void remove_folder( MSIFOLDER *folder )
UINT ACTION_RemoveFiles( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','R','e','m','o','v','e','F','i','l','e','`',0};
MSIQUERY *view;
MSICOMPONENT *comp;
MSIFILE *file;
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRemoveFiles);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFiles");
- r = MSI_DatabaseOpenViewW(package->db, query, &view);
+ r = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `RemoveFile`", &view);
if (r == ERROR_SUCCESS)
{
r = MSI_IterateRecords(view, NULL, ITERATE_RemoveFiles, package);
@@ -1583,7 +1570,7 @@ UINT ACTION_RemoveFiles( MSIPACKAGE *package )
VS_FIXEDFILEINFO *ver;
comp = file->Component;
- msi_file_update_ui( package, file, szRemoveFiles );
+ msi_file_update_ui( package, file, L"RemoveFiles" );
comp->Action = msi_get_component_action( package, comp );
if (comp->Action != INSTALLSTATE_ABSENT || comp->Installed == INSTALLSTATE_SOURCE)
diff --git a/dlls/msi/font.c b/dlls/msi/font.c
index f26d3fd99c3..78d384b1654 100644
--- a/dlls/msi/font.c
+++ b/dlls/msi/font.c
@@ -66,19 +66,6 @@ typedef struct _tagTT_NAME_RECORD {
#define SWAPWORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)), SWAPWORD(LOWORD(x)))
-static const WCHAR regfont1[] =
- {'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s',' ','N','T','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'F','o','n','t','s',0};
-static const WCHAR regfont2[] =
- {'S','o','f','t','w','a','r','e','\\',
- 'M','i','c','r','o','s','o','f','t','\\',
- 'W','i','n','d','o','w','s','\\',
- 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
- 'F','o','n','t','s',0};
-
/*
* Code based off of code located here
* http://www.codeproject.com/gdi/fontnamefromfile.asp
@@ -178,7 +165,6 @@ end:
static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
{
- static const WCHAR truetypeW[] = {' ','(','T','r','u','e','T','y','p','e',')',0};
WCHAR *name, *ret = NULL;
if ((name = load_ttf_name_id( package, filename, NAME_ID_FULL_FONT_NAME )))
@@ -189,9 +175,9 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
msi_free( name );
return NULL;
}
- ret = msi_alloc( (lstrlenW( name ) + lstrlenW( truetypeW ) + 1 ) * sizeof(WCHAR) );
+ ret = msi_alloc( (lstrlenW( name ) + lstrlenW( L" (TrueType)" ) + 1 ) * sizeof(WCHAR) );
lstrcpyW( ret, name );
- lstrcatW( ret, truetypeW );
+ lstrcatW( ret, L" (TrueType)" );
msi_free( name );
}
return ret;
@@ -199,7 +185,6 @@ static WCHAR *font_name_from_file( MSIPACKAGE *package, const WCHAR *filename )
WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename )
{
- static const WCHAR fmtW[] = {'%','u','.','%','u','.','0','.','0',0};
WCHAR *version, *p, *q, *ret = NULL;
if ((version = load_ttf_name_id( package, filename, NAME_ID_VERSION )))
@@ -216,9 +201,9 @@ WCHAR *msi_get_font_file_version( MSIPACKAGE *package, const WCHAR *filename )
if (!*q || *q == ' ') minor = wcstol( p, NULL, 10 );
else major = 0;
}
- len = lstrlenW( fmtW ) + 20;
+ len = lstrlenW( L"%u.%u.0.0" ) + 20;
ret = msi_alloc( len * sizeof(WCHAR) );
- swprintf( ret, len, fmtW, major, minor );
+ swprintf( ret, len, L"%u.%u.0.0", major, minor );
msi_free( version );
}
return ret;
@@ -255,8 +240,8 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
return ERROR_SUCCESS;
}
- RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont1,&hkey1);
- RegCreateKeyW(HKEY_LOCAL_MACHINE,regfont2,&hkey2);
+ RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" ,&hkey1 );
+ RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts", &hkey2 );
if (MSI_RecordIsNull(row,2))
name = font_name_from_file( package, file->TargetPath );
@@ -290,15 +275,13 @@ static UINT ITERATE_RegisterFonts(MSIRECORD *row, LPVOID param)
UINT ACTION_RegisterFonts(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','F','o','n','t','`',0};
MSIQUERY *view;
UINT rc;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szRegisterFonts);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterFonts");
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Font`", &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -338,8 +321,8 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
return ERROR_SUCCESS;
}
- RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont1, &hkey1 );
- RegCreateKeyW( HKEY_LOCAL_MACHINE, regfont2, &hkey2 );
+ RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", &hkey1 );
+ RegCreateKeyW( HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Fonts", &hkey2 );
if (MSI_RecordIsNull( row, 2 ))
name = font_name_from_file( package, file->TargetPath );
@@ -373,15 +356,13 @@ static UINT ITERATE_UnregisterFonts( MSIRECORD *row, LPVOID param )
UINT ACTION_UnregisterFonts( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','F','o','n','t','`',0};
MSIQUERY *view;
UINT r;
if (package->script == SCRIPT_NONE)
- return msi_schedule_action(package, SCRIPT_INSTALL, szUnregisterFonts);
+ return msi_schedule_action(package, SCRIPT_INSTALL, L"UnregisterFonts");
- r = MSI_DatabaseOpenViewW( package->db, query, &view );
+ r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Font`", &view );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
diff --git a/dlls/msi/format.c b/dlls/msi/format.c
index 77e6dd153c4..9e97c23aaad 100644
--- a/dlls/msi/format.c
+++ b/dlls/msi/format.c
@@ -341,7 +341,6 @@ static WCHAR *deformat_literal( FORMAT *format, FORMSTR *str, BOOL *propfound,
static WCHAR *build_default_format( const MSIRECORD *record )
{
- static const WCHAR fmt[] = {'%','i',':',' ','[','%','i',']',' ',0};
int i, count = MSI_RecordGetFieldCount( record );
WCHAR *ret, *tmp, buf[26];
DWORD size = 1;
@@ -351,7 +350,7 @@ static WCHAR *build_default_format( const MSIRECORD *record )
for (i = 1; i <= count; i++)
{
- size += swprintf( buf, ARRAY_SIZE(buf), fmt, i, i );
+ size += swprintf( buf, ARRAY_SIZE(buf), L"%d: [%d] ", i, i );
if (!(tmp = msi_realloc( ret, size * sizeof(*ret) )))
{
msi_free( ret );
@@ -754,7 +753,7 @@ static BOOL verify_format(LPWSTR data)
return TRUE;
}
-static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
+static DWORD deformat_string_internal(MSIPACKAGE *package, LPCWSTR ptr,
WCHAR** data, DWORD *len,
MSIRECORD* record)
{
@@ -898,7 +897,7 @@ end:
return rc;
}
-UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord,
+UINT WINAPI MsiFormatRecordW( MSIHANDLE hInstall, MSIHANDLE hRecord,
LPWSTR szResult, LPDWORD sz )
{
UINT r = ERROR_INVALID_HANDLE;
diff --git a/dlls/msi/install.c b/dlls/msi/install.c
index 4277b51804f..a3bfb53cfff 100644
--- a/dlls/msi/install.c
+++ b/dlls/msi/install.c
@@ -52,7 +52,7 @@ UINT WINAPI MsiDoActionA( MSIHANDLE hInstall, LPCSTR szAction )
szwAction = strdupAtoW(szAction);
if (szAction && !szwAction)
- return ERROR_FUNCTION_FAILED;
+ return ERROR_FUNCTION_FAILED;
ret = MsiDoActionW( hInstall, szwAction );
msi_free( szwAction );
@@ -92,7 +92,7 @@ UINT WINAPI MsiDoActionW( MSIHANDLE hInstall, LPCWSTR szAction )
return ret;
}
-
+
ret = ACTION_PerformAction(package, szAction);
msiobj_release( &package->hdr );
@@ -111,7 +111,7 @@ UINT WINAPI MsiSequenceA( MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode
szwTable = strdupAtoW(szTable);
if (szTable && !szwTable)
- return ERROR_FUNCTION_FAILED;
+ return ERROR_FUNCTION_FAILED;
ret = MsiSequenceW( hInstall, szwTable, iSequenceMode );
msi_free( szwTable );
@@ -166,7 +166,7 @@ UINT msi_strcpy_to_awstring( const WCHAR *str, int len, awstring *awbuf, DWORD *
return ERROR_SUCCESS;
if (len < 0) len = lstrlenW( str );
-
+
if (awbuf->unicode && awbuf->str.w)
{
memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
@@ -359,7 +359,7 @@ UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf,
static WCHAR *get_source_root( MSIPACKAGE *package )
{
msi_set_sourcedir_props( package, FALSE );
- return msi_dup_property( package->db, szSourceDir );
+ return msi_dup_property( package->db, L"SourceDir" );
}
WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder )
@@ -369,11 +369,11 @@ WCHAR *msi_resolve_source_folder( MSIPACKAGE *package, const WCHAR *name, MSIFOL
TRACE("working to resolve %s\n", debugstr_w(name));
- if (!wcscmp( name, szSourceDir )) name = szTargetDir;
+ if (!wcscmp( name, L"SourceDir" )) name = L"TARGETDIR";
if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
/* special resolving for root dir */
- if (!wcscmp( name, szTargetDir ) && !f->ResolvedSource)
+ if (!wcscmp( name, L"TARGETDIR" ) && !f->ResolvedSource)
{
f->ResolvedSource = get_source_root( package );
}
@@ -598,7 +598,7 @@ UINT MSI_SetTargetPathW( MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolder
/***********************************************************************
* MsiSetTargetPathW (MSI.@)
*/
-UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder,
+UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder,
LPCWSTR szFolderPath)
{
MSIPACKAGE *package;
@@ -730,11 +730,11 @@ BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
break;
case MSIRUNMODE_MAINTENANCE:
- r = msi_get_property_int( package->db, szInstalled, 0 ) != 0;
+ r = msi_get_property_int( package->db, L"Installed", 0 ) != 0;
break;
case MSIRUNMODE_ROLLBACKENABLED:
- r = msi_get_property_int( package->db, szRollbackDisabled, 0 ) == 0;
+ r = msi_get_property_int( package->db, L"RollbackDisabled", 0 ) == 0;
break;
case MSIRUNMODE_REBOOTATEND:
@@ -823,7 +823,7 @@ UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
szwFeature = strdupAtoW(szFeature);
- rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
+ rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
msi_free(szwFeature);
@@ -924,7 +924,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE
if (!feature)
return ERROR_UNKNOWN_FEATURE;
- if (iState == INSTALLSTATE_ADVERTISED &&
+ if (iState == INSTALLSTATE_ADVERTISED &&
feature->Attributes & msidbFeatureAttributesDisallowAdvertise)
return ERROR_FUNCTION_FAILED;
@@ -938,7 +938,7 @@ UINT MSI_SetFeatureStateW( MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE
if (child->Feature_Parent && !wcscmp( szFeature, child->Feature_Parent ))
MSI_SetFeatureStateW(package, child->Feature, iState);
}
-
+
return rc;
}
@@ -1029,8 +1029,8 @@ UINT WINAPI MsiSetFeatureAttributesW( MSIHANDLE handle, LPCWSTR name, DWORD attr
if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
return ERROR_INVALID_HANDLE;
- costing = msi_dup_property( package->db, szCostingComplete );
- if (!costing || !wcscmp( costing, szOne ))
+ costing = msi_dup_property( package->db, L"CostingComplete" );
+ if (!costing || !wcscmp( costing, L"1" ))
{
msi_free( costing );
msiobj_release( &package->hdr );
@@ -1055,7 +1055,7 @@ UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature,
{
LPWSTR szwFeature = NULL;
UINT rc;
-
+
if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY;
rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction);
@@ -1400,7 +1400,7 @@ UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent,
{
LPWSTR szwComponent= NULL;
UINT rc;
-
+
szwComponent= strdupAtoW(szComponent);
rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction);
@@ -1567,14 +1567,13 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
return langid;
}
- langid = msi_get_property_int( package->db, szProductLanguage, 0 );
+ langid = msi_get_property_int( package->db, L"ProductLanguage", 0 );
msiobj_release( &package->hdr );
return langid;
}
UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
{
- static const WCHAR fmt[] = { '%','d',0 };
WCHAR level[6];
int len;
UINT r;
@@ -1587,8 +1586,8 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
if (iInstallLevel < 1)
return MSI_SetFeatureStates( package );
- len = swprintf( level, ARRAY_SIZE(level), fmt, iInstallLevel );
- r = msi_set_property( package->db, szInstallLevel, level, len );
+ len = swprintf( level, ARRAY_SIZE(level), L"%d", iInstallLevel );
+ r = msi_set_property( package->db, L"INSTALLLEVEL", level, len );
if ( r == ERROR_SUCCESS )
r = MSI_SetFeatureStates( package );
diff --git a/dlls/msi/media.c b/dlls/msi/media.c
index 05a751092a3..41c82af1b59 100644
--- a/dlls/msi/media.c
+++ b/dlls/msi/media.c
@@ -82,7 +82,7 @@ static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)
LPWSTR source_dir;
UINT r = IDRETRY;
- source_dir = msi_dup_property(package->db, szSourceDir);
+ source_dir = msi_dup_property(package->db, L"SourceDir");
record = MSI_CreateRecord(2);
while (r == IDRETRY && !source_matches_volume(mi, source_dir))
@@ -275,12 +275,7 @@ static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi)
{
MSIRECORD *row;
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
- '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
- '`','D','i','s','k','I','d','`',' ','=',' ','%','i',0};
-
- row = MSI_QueryGetRecord(package->db, query, mi->disk_id);
+ row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `DiskId` = %d", mi->disk_id);
if (!row)
{
TRACE("Unable to query row\n");
@@ -473,7 +468,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint,
msi_free( tmppathW );
return ERROR_OUTOFMEMORY;
}
- if (!GetTempFileNameW(tmppathW, szMsi, 0, tmpfileW)) tmpfileW[0] = 0;
+ if (!GetTempFileNameW(tmppathW, L"msi", 0, tmpfileW)) tmpfileW[0] = 0;
msi_free( tmppathW );
handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL);
@@ -679,7 +674,7 @@ static UINT get_drive_type(const WCHAR *path)
static WCHAR *get_base_url( MSIDATABASE *db )
{
- WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, szOriginalDatabase );
+ WCHAR *p, *ret = NULL, *orig_db = msi_dup_property( db, L"OriginalDatabase" );
if (UrlIsW( orig_db, URLIS_URL ) && (ret = strdupW( orig_db )) && (p = wcsrchr( ret, '/'))) p[1] = 0;
msi_free( orig_db );
return ret;
@@ -687,10 +682,6 @@ static WCHAR *get_base_url( MSIDATABASE *db )
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
- 'W','H','E','R','E',' ','`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
- '>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
MSIRECORD *row;
WCHAR *source_dir, *source, *base_url = NULL;
DWORD options;
@@ -698,7 +689,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
if (Sequence <= mi->last_sequence) /* already loaded */
return ERROR_SUCCESS;
- row = MSI_QueryGetRecord(package->db, query, Sequence);
+ row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d ORDER BY `DiskId`", Sequence);
if (!row)
{
TRACE("Unable to query row\n");
@@ -717,7 +708,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
msiobj_release(&row->hdr);
msi_set_sourcedir_props(package, FALSE);
- source_dir = msi_dup_property(package->db, szSourceDir);
+ source_dir = msi_dup_property(package->db, L"SourceDir");
lstrcpyW(mi->sourcedir, source_dir);
PathAddBackslashW(mi->sourcedir);
mi->type = get_drive_type(source_dir);
@@ -902,7 +893,7 @@ UINT ready_media( MSIPACKAGE *package, BOOL compressed, MSIMEDIAINFO *mi )
/* assume first volume is in the drive */
if (mi->last_volume && wcsicmp( mi->last_volume, mi->volume_label ))
{
- WCHAR *source = msi_dup_property( package->db, szSourceDir );
+ WCHAR *source = msi_dup_property( package->db, L"SourceDir" );
BOOL match = source_matches_volume( mi, source );
msi_free( source );
diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 71de13a8ffc..0963c814211 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -2469,7 +2469,7 @@ UINT WINAPI MsiMessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uTyp
{
FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_a(lpText), debugstr_a(lpCaption),
uType, wLanguageId, f);
- return MessageBoxExA(hWnd,lpText,lpCaption,uType,wLanguageId);
+ return MessageBoxExA(hWnd,lpText,lpCaption,uType,wLanguageId);
}
UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType,
@@ -2477,7 +2477,7 @@ UINT WINAPI MsiMessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uT
{
FIXME("%p %s %s %u %08x %08x\n", hWnd, debugstr_w(lpText), debugstr_w(lpCaption),
uType, wLanguageId, f);
- return MessageBoxExW(hWnd,lpText,lpCaption,uType,wLanguageId);
+ return MessageBoxExW(hWnd,lpText,lpCaption,uType,wLanguageId);
}
UINT WINAPI MsiMessageBoxExA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType,
@@ -3522,7 +3522,7 @@ UINT WINAPI MsiProvideQualifiedComponentW( LPCWSTR szComponent,
LPCWSTR szQualifier, DWORD dwInstallMode, LPWSTR lpPathBuf,
LPDWORD pcchPathBuf)
{
- return MsiProvideQualifiedComponentExW(szComponent, szQualifier,
+ return MsiProvideQualifiedComponentExW(szComponent, szQualifier,
dwInstallMode, NULL, 0, 0, lpPathBuf, pcchPathBuf);
}
@@ -3989,7 +3989,7 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature, DWORD dw
if (dwReinstallMode & REINSTALLMODE_PACKAGE)
*ptr++ = 'v';
*ptr = 0;
-
+
sz = sizeof(sourcepath);
MsiSourceListGetInfoW( szProduct, NULL, context, MSICODE_PRODUCT,
INSTALLPROPERTY_LASTUSEDSOURCEW, sourcepath, &sz );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index a1b7f033c37..950a18d0e74 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -1137,111 +1137,6 @@ extern DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR f
/* User interface messages from the actions */
extern void msi_ui_progress(MSIPACKAGE *, int, int, int, int) DECLSPEC_HIDDEN;
-/* common strings */
-static const WCHAR szSourceDir[] = {'S','o','u','r','c','e','D','i','r',0};
-static const WCHAR szSOURCEDIR[] = {'S','O','U','R','C','E','D','I','R',0};
-static const WCHAR szRootDrive[] = {'R','O','O','T','D','R','I','V','E',0};
-static const WCHAR szTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
-static const WCHAR szLocalSid[] = {'S','-','1','-','5','-','1','8',0};
-static const WCHAR szAllSid[] = {'S','-','1','-','1','-','0',0};
-static const WCHAR szEmpty[] = {0};
-static const WCHAR szAll[] = {'A','L','L',0};
-static const WCHAR szOne[] = {'1',0};
-static const WCHAR szZero[] = {'0',0};
-static const WCHAR szSpace[] = {' ',0};
-static const WCHAR szBackSlash[] = {'\\',0};
-static const WCHAR szForwardSlash[] = {'/',0};
-static const WCHAR szDot[] = {'.',0};
-static const WCHAR szDotDot[] = {'.','.',0};
-static const WCHAR szSemiColon[] = {';',0};
-static const WCHAR szPreselected[] = {'P','r','e','s','e','l','e','c','t','e','d',0};
-static const WCHAR szPatches[] = {'P','a','t','c','h','e','s',0};
-static const WCHAR szState[] = {'S','t','a','t','e',0};
-static const WCHAR szMsi[] = {'m','s','i',0};
-static const WCHAR szPatch[] = {'P','A','T','C','H',0};
-static const WCHAR szSourceList[] = {'S','o','u','r','c','e','L','i','s','t',0};
-static const WCHAR szInstalled[] = {'I','n','s','t','a','l','l','e','d',0};
-static const WCHAR szReinstall[] = {'R','E','I','N','S','T','A','L','L',0};
-static const WCHAR szReinstallMode[] = {'R','E','I','N','S','T','A','L','L','M','O','D','E',0};
-static const WCHAR szRemove[] = {'R','E','M','O','V','E',0};
-static const WCHAR szUserSID[] = {'U','s','e','r','S','I','D',0};
-static const WCHAR szProductCode[] = {'P','r','o','d','u','c','t','C','o','d','e',0};
-static const WCHAR szRegisterClassInfo[] = {'R','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
-static const WCHAR szRegisterProgIdInfo[] = {'R','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
-static const WCHAR szRegisterExtensionInfo[] = {'R','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
-static const WCHAR szRegisterMIMEInfo[] = {'R','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
-static const WCHAR szDuplicateFiles[] = {'D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
-static const WCHAR szRemoveDuplicateFiles[] = {'R','e','m','o','v','e','D','u','p','l','i','c','a','t','e','F','i','l','e','s',0};
-static const WCHAR szInstallFiles[] = {'I','n','s','t','a','l','l','F','i','l','e','s',0};
-static const WCHAR szPatchFiles[] = {'P','a','t','c','h','F','i','l','e','s',0};
-static const WCHAR szRemoveFiles[] = {'R','e','m','o','v','e','F','i','l','e','s',0};
-static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t','e','d','P','r','o','d','u','c','t','s',0};
-static const WCHAR szAllUsers[] = {'A','L','L','U','S','E','R','S',0};
-static const WCHAR szCustomActionData[] = {'C','u','s','t','o','m','A','c','t','i','o','n','D','a','t','a',0};
-static const WCHAR szUILevel[] = {'U','I','L','e','v','e','l',0};
-static const WCHAR szProductID[] = {'P','r','o','d','u','c','t','I','D',0};
-static const WCHAR szPIDTemplate[] = {'P','I','D','T','e','m','p','l','a','t','e',0};
-static const WCHAR szPIDKEY[] = {'P','I','D','K','E','Y',0};
-static const WCHAR szTYPELIB[] = {'T','Y','P','E','L','I','B',0};
-static const WCHAR szSumInfo[] = {5 ,'S','u','m','m','a','r','y','I','n','f','o','r','m','a','t','i','o','n',0};
-static const WCHAR szHCR[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T','\\',0};
-static const WCHAR szHCU[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R','\\',0};
-static const WCHAR szHLM[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E','\\',0};
-static const WCHAR szHU[] = {'H','K','E','Y','_','U','S','E','R','S','\\',0};
-static const WCHAR szWindowsFolder[] = {'W','i','n','d','o','w','s','F','o','l','d','e','r',0};
-static const WCHAR szAppSearch[] = {'A','p','p','S','e','a','r','c','h',0};
-static const WCHAR szMoveFiles[] = {'M','o','v','e','F','i','l','e','s',0};
-static const WCHAR szCCPSearch[] = {'C','C','P','S','e','a','r','c','h',0};
-static const WCHAR szUnregisterClassInfo[] = {'U','n','r','e','g','i','s','t','e','r','C','l','a','s','s','I','n','f','o',0};
-static const WCHAR szUnregisterExtensionInfo[] = {'U','n','r','e','g','i','s','t','e','r','E','x','t','e','n','s','i','o','n','I','n','f','o',0};
-static const WCHAR szUnregisterMIMEInfo[] = {'U','n','r','e','g','i','s','t','e','r','M','I','M','E','I','n','f','o',0};
-static const WCHAR szUnregisterProgIdInfo[] = {'U','n','r','e','g','i','s','t','e','r','P','r','o','g','I','d','I','n','f','o',0};
-static const WCHAR szRegisterFonts[] = {'R','e','g','i','s','t','e','r','F','o','n','t','s',0};
-static const WCHAR szUnregisterFonts[] = {'U','n','r','e','g','i','s','t','e','r','F','o','n','t','s',0};
-static const WCHAR szCLSID[] = {'C','L','S','I','D',0};
-static const WCHAR szProgID[] = {'P','r','o','g','I','D',0};
-static const WCHAR szVIProgID[] = {'V','e','r','s','i','o','n','I','n','d','e','p','e','n','d','e','n','t','P','r','o','g','I','D',0};
-static const WCHAR szAppID[] = {'A','p','p','I','D',0};
-static const WCHAR szDefaultIcon[] = {'D','e','f','a','u','l','t','I','c','o','n',0};
-static const WCHAR szInprocHandler[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r',0};
-static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d','l','e','r','3','2',0};
-static const WCHAR szMIMEDatabase[] = {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',' ','T','y','p','e','\\',0};
-static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
-static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
-static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
-static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0};
-static const WCHAR szIntel[] = {'I','n','t','e','l',0};
-static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0};
-static const WCHAR szX64[] = {'x','6','4',0};
-static const WCHAR szAMD64[] = {'A','M','D','6','4',0};
-static const WCHAR szARM[] = {'A','r','m',0};
-static const WCHAR szARM64[] = {'A','r','m','6','4',0};
-static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0};
-static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0};
-static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
-static const WCHAR szMsiUnpublishAssemblies[] = {'M','s','i','U','n','p','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
-static const WCHAR szCostingComplete[] = {'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0};
-static const WCHAR szTempFolder[] = {'T','e','m','p','F','o','l','d','e','r',0};
-static const WCHAR szDatabase[] = {'D','A','T','A','B','A','S','E',0};
-static const WCHAR szCRoot[] = {'C',':','\\',0};
-static const WCHAR szProductLanguage[] = {'P','r','o','d','u','c','t','L','a','n','g','u','a','g','e',0};
-static const WCHAR szProductVersion[] = {'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0};
-static const WCHAR szWindowsInstaller[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
-static const WCHAR szStringData[] = {'_','S','t','r','i','n','g','D','a','t','a',0};
-static const WCHAR szStringPool[] = {'_','S','t','r','i','n','g','P','o','o','l',0};
-static const WCHAR szInstallLevel[] = {'I','N','S','T','A','L','L','L','E','V','E','L',0};
-static const WCHAR szCostInitialize[] = {'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0};
-static const WCHAR szAppDataFolder[] = {'A','p','p','D','a','t','a','F','o','l','d','e','r',0};
-static const WCHAR szRollbackDisabled[] = {'R','o','l','l','b','a','c','k','D','i','s','a','b','l','e','d',0};
-static const WCHAR szName[] = {'N','a','m','e',0};
-static const WCHAR szData[] = {'D','a','t','a',0};
-static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0};
-static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0};
-static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0};
-static const WCHAR szUninstallable[] = {'U','n','i','n','s','t','a','l','l','a','b','l','e',0};
-static const WCHAR szEXECUTEACTION[] = {'E','X','E','C','U','T','E','A','C','T','I','O','N',0};
-static const WCHAR szProductToBeRegistered[] = {'P','r','o','d','u','c','t','T','o','B','e','R','e','g','i','s','t','e','r','e','d',0};
-
/* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *msi_alloc( size_t len )
diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index 7791ee9b91a..4ee9a973917 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -517,7 +517,7 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
MSIQUERY *query;
MSIRECORD *rec = NULL;
UINT ret;
-
+
TRACE("%d %d\n", hView, hRec);
if( hRec )
@@ -564,7 +564,6 @@ UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
UINT type, BOOL temporary )
{
- static const WCHAR fmt[] = { '%','d',0 };
WCHAR szType[0x10];
if (MSITYPE_IS_BINARY(type))
@@ -591,7 +590,7 @@ static UINT msi_set_record_type_string( MSIRECORD *rec, UINT field,
if (type & MSITYPE_NULLABLE)
szType[0] &= ~0x20;
- swprintf( &szType[1], ARRAY_SIZE(szType) - 1, fmt, (type&0xff) );
+ swprintf( &szType[1], ARRAY_SIZE(szType) - 1, L"%d", (type&0xff) );
TRACE("type %04x -> %s\n", type, debugstr_w(szType) );
@@ -798,7 +797,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf
}
__ENDTRY;
- if (msi_strncpyW(remote_column ? remote_column : szEmpty, -1, buffer, buflen) == ERROR_MORE_DATA)
+ if (msi_strncpyW(remote_column ? remote_column : L"", -1, buffer, buflen) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA;
if (remote_column)
@@ -808,7 +807,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR buffer, LPDWORD buf
}
if ((r = query->view->error)) column = query->view->error_column;
- else column = szEmpty;
+ else column = L"";
if (msi_strncpyW(column, -1, buffer, buflen) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA;
@@ -849,7 +848,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl
}
__ENDTRY;
- if (msi_strncpyWtoA(remote_column ? remote_column : szEmpty, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
+ if (msi_strncpyWtoA(remote_column ? remote_column : L"", -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA;
if (remote_column)
@@ -859,7 +858,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR buffer, LPDWORD bufl
}
if ((r = query->view->error)) column = query->view->error_column;
- else column = szEmpty;
+ else column = L"";
if (msi_strncpyWtoA(column, -1, buffer, buflen, FALSE) == ERROR_MORE_DATA)
r = MSIDBERROR_MOREDATA;
@@ -1045,11 +1044,6 @@ static UINT msi_primary_key_iterator( MSIRECORD *rec, LPVOID param )
UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
LPCWSTR table, MSIRECORD **prec )
{
- static const WCHAR sql[] = {
- 's','e','l','e','c','t',' ','*',' ',
- 'f','r','o','m',' ','`','_','C','o','l','u','m','n','s','`',' ',
- 'w','h','e','r','e',' ',
- '`','T','a','b','l','e','`',' ','=',' ','\'','%','s','\'',0 };
struct msi_primary_key_record_info info;
MSIQUERY *query = NULL;
UINT r;
@@ -1057,7 +1051,7 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
if (!TABLE_Exists( db, table ))
return ERROR_INVALID_TABLE;
- r = MSI_OpenQuery( db, &query, sql, table );
+ r = MSI_OpenQuery( db, &query, L"SELECT * FROM `_Columns` WHERE `Table` = '%s'", table );
if( r != ERROR_SUCCESS )
return r;
@@ -1133,7 +1127,7 @@ UINT WINAPI MsiDatabaseGetPrimaryKeysW( MSIHANDLE hdb,
return r;
}
-UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb,
+UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb,
LPCSTR table, MSIHANDLE* phRec)
{
LPWSTR szwTable = NULL;
diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c
index 67da5778415..35b2784ba85 100644
--- a/dlls/msi/patch.c
+++ b/dlls/msi/patch.c
@@ -179,7 +179,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
}
if (wanted_flags & MSITRANSFORM_VALIDATE_PRODUCT)
{
- WCHAR *product_code_installed = msi_dup_property( package->db, szProductCode );
+ WCHAR *product_code_installed = msi_dup_property( package->db, L"ProductCode" );
if (!product_code_installed)
{
@@ -197,7 +197,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
msi_free( template );
if (wanted_flags & MSITRANSFORM_VALIDATE_MAJORVERSION)
{
- WCHAR *product_version_installed = msi_dup_property( package->db, szProductVersion );
+ WCHAR *product_version_installed = msi_dup_property( package->db, L"ProductVersion" );
DWORD major_installed, minor_installed, major, minor;
if (!product_version_installed)
@@ -218,7 +218,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
}
else if (wanted_flags & MSITRANSFORM_VALIDATE_MINORVERSION)
{
- WCHAR *product_version_installed = msi_dup_property( package->db, szProductVersion );
+ WCHAR *product_version_installed = msi_dup_property( package->db, L"ProductVersion" );
DWORD major_installed, minor_installed, major, minor;
if (!product_version_installed)
@@ -236,7 +236,7 @@ static UINT check_transform_applicable( MSIPACKAGE *package, IStorage *transform
}
if (wanted_flags & MSITRANSFORM_VALIDATE_UPGRADECODE)
{
- WCHAR *upgrade_code_installed = msi_dup_property( package->db, szUpgradeCode );
+ WCHAR *upgrade_code_installed = msi_dup_property( package->db, L"UpgradeCode" );
if (!upgrade_code_installed)
{
@@ -296,7 +296,7 @@ UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si )
LPWSTR guid_list, *guids, product_code;
UINT i, ret = ERROR_FUNCTION_FAILED;
- product_code = msi_dup_property( package->db, szProductCode );
+ product_code = msi_dup_property( package->db, L"ProductCode" );
if (!product_code)
{
/* FIXME: the property ProductCode should be written into the DB somewhere */
@@ -368,17 +368,13 @@ static UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
static UINT patch_set_media_source_prop( MSIPACKAGE *package )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','`','S','o','u','r','c','e','`',' ','F','R','O','M',' ',
- '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ','`','S','o','u','r','c','e','`',' ',
- 'I','S',' ','N','O','T',' ','N','U','L','L',0};
MSIQUERY *view;
MSIRECORD *rec;
const WCHAR *property;
WCHAR *patch;
UINT r;
- r = MSI_DatabaseOpenViewW( package->db, query, &view );
+ r = MSI_DatabaseOpenViewW( package->db, L"SELECT `Source` FROM `Media` WHERE `Source` IS NOT NULL", &view );
if (r != ERROR_SUCCESS)
return r;
@@ -389,7 +385,7 @@ static UINT patch_set_media_source_prop( MSIPACKAGE *package )
if (MSI_ViewFetch( view, &rec ) == ERROR_SUCCESS)
{
property = MSI_RecordGetString( rec, 1 );
- patch = msi_dup_property( package->db, szPatch );
+ patch = msi_dup_property( package->db, L"PATCH" );
msi_set_property( package->db, property, patch, -1 );
msi_free( patch );
msiobj_release( &rec->hdr );
@@ -444,15 +440,11 @@ static void patch_offset_list_free( struct patch_offset_list *pos )
static void patch_offset_get_filepatches( MSIDATABASE *db, UINT last_sequence, struct patch_offset_list *pos )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','P','a','t','c','h',' ',
- 'W','H','E','R','E',' ','S','e','q','u','e','n','c','e',' ','<','=',' ','?',' ',
- 'O','R','D','E','R',' ','B','Y',' ','S','e','q','u','e','n','c','e',0};
MSIQUERY *view;
MSIRECORD *rec;
UINT r;
- r = MSI_DatabaseOpenViewW( db, query, &view );
+ r = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `Patch` WHERE `Sequence` <= ? ORDER BY `Sequence`", &view );
if (r != ERROR_SUCCESS)
return;
@@ -482,15 +474,11 @@ static void patch_offset_get_filepatches( MSIDATABASE *db, UINT last_sequence, s
static void patch_offset_get_files( MSIDATABASE *db, UINT last_sequence, struct patch_offset_list *pos )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','F','i','l','e',' ',
- 'W','H','E','R','E',' ','S','e','q','u','e','n','c','e',' ','<','=',' ','?',' ',
- 'O','R','D','E','R',' ','B','Y',' ','S','e','q','u','e','n','c','e',0};
MSIQUERY *view;
MSIRECORD *rec;
UINT r;
- r = MSI_DatabaseOpenViewW( db, query, &view );
+ r = MSI_DatabaseOpenViewW( db, L"SELECT * FROM `File` WHERE `Sequence` <= ? ORDER BY `Sequence`", &view );
if (r != ERROR_SUCCESS)
return;
@@ -545,16 +533,6 @@ static UINT patch_update_file_sequence( MSIDATABASE *db, const struct patch_offs
static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch_offset_list *pos,
MSIQUERY *view, MSIRECORD *rec )
{
- static const WCHAR delete_query[] = {
- 'D','E','L','E','T','E',' ','F','R','O','M',' ','`','P','a','t','c','h','`',' ',
- 'W','H','E','R','E',' ','`','F','i','l','e','_','`',' ','=',' ','?',' ',
- 'A','N','D',' ','`','S','e','q','u','e','n','c','e','`',' ','=',' ','?',0};
- static const WCHAR insert_query[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ','`','P','a','t','c','h','`',' ',
- '(','`','F','i','l','e','_','`',',','`','S','e','q','u','e','n','c','e','`',',',
- '`','P','a','t','c','h','S','i','z','e','`',',','`','A','t','t','r','i','b','u','t','e','s','`',',',
- '`','H','e','a','d','e','r','`',',','`','S','t','r','e','a','m','R','e','f','_','`',')',' ',
- 'V','A','L','U','E','S',' ','(','?',',','?',',','?',',','?',',','?',',','?',')',0};
struct patch_offset *po;
const WCHAR *file = MSI_RecordGetString( rec, 1 );
UINT r = ERROR_SUCCESS, seq = MSI_RecordGetInteger( rec, 2 );
@@ -566,7 +544,7 @@ static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch
MSIQUERY *delete_view, *insert_view;
MSIRECORD *rec2;
- r = MSI_DatabaseOpenViewW( db, delete_query, &delete_view );
+ r = MSI_DatabaseOpenViewW( db, L"DELETE FROM `Patch` WHERE `File_` = ? AND `Sequence` = ?", &delete_view );
if (r != ERROR_SUCCESS) return r;
rec2 = MSI_CreateRecord( 2 );
@@ -577,7 +555,8 @@ static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch
msiobj_release( &rec2->hdr );
if (r != ERROR_SUCCESS) return r;
- r = MSI_DatabaseOpenViewW( db, insert_query, &insert_view );
+ r = MSI_DatabaseOpenViewW( db, L"INSERT INTO `Patch` (`File_`,`Sequence`,`PatchSize`,`Attributes`,"
+ L"`Header`,`StreamRef_`) VALUES (?,?,?,?,?,?)", &insert_view );
if (r != ERROR_SUCCESS) return r;
MSI_RecordSetInteger( rec, 2, po->sequence + pos->offset_to_apply );
@@ -594,21 +573,13 @@ static UINT patch_update_filepatch_sequence( MSIDATABASE *db, const struct patch
static UINT patch_offset_modify_db( MSIDATABASE *db, struct patch_offset_list *pos )
{
- static const WCHAR file_query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','F','i','l','e','`',' ',
- 'W','H','E','R','E',' ','`','S','e','q','u','e','n','c','e','`',' ','>','=',' ','?',' ',
- 'A','N','D',' ','`','S','e','q','u','e','n','c','e','`',' ','<','=',' ','?',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','S','e','q','u','e','n','c','e','`',0};
- static const WCHAR patch_query[] = {
- 'S','E','L','E','C','T',' ','*','F','R','O','M',' ','`','P','a','t','c','h','`',' ',
- 'W','H','E','R','E',' ','`','S','e','q','u','e','n','c','e','`',' ','>','=',' ','?',' ',
- 'A','N','D',' ','`','S','e','q','u','e','n','c','e','`',' ','<','=',' ','?',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','S','e','q','u','e','n','c','e','`',0};
MSIRECORD *rec;
MSIQUERY *view;
UINT r, min = pos->min, max = pos->max, r_fetch;
- r = MSI_DatabaseOpenViewW( db, file_query, &view );
+ r = MSI_DatabaseOpenViewW( db,
+ L"SELECT * FROM `File` WHERE `Sequence` >= ? AND `Sequence` <= ? ORDER BY `Sequence`",
+ &view );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -629,7 +600,9 @@ static UINT patch_offset_modify_db( MSIDATABASE *db, struct patch_offset_list *p
}
msiobj_release( &view->hdr );
- r = MSI_DatabaseOpenViewW( db, patch_query, &view );
+ r = MSI_DatabaseOpenViewW( db,
+ L"SELECT *FROM `Patch` WHERE `Sequence` >= ? AND `Sequence` <= ? ORDER BY `Sequence`",
+ &view );
if (r != ERROR_SUCCESS)
return ERROR_SUCCESS;
@@ -654,11 +627,8 @@ done:
return r;
}
-static const WCHAR patch_media_query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
- 'W','H','E','R','E',' ','`','S','o','u','r','c','e','`',' ','I','S',' ','N','O','T',' ','N','U','L','L',' ',
- 'A','N','D',' ','`','C','a','b','i','n','e','t','`',' ','I','S',' ','N','O','T',' ','N','U','L','L',' ',
- 'O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
+static const WCHAR patch_media_query[] =
+ L"SELECT * FROM `Media` WHERE `Source` IS NOT NULL AND `Cabinet` IS NOT NULL ORDER BY `DiskId`";
struct patch_media
{
@@ -673,15 +643,6 @@ struct patch_media
static UINT patch_add_media( MSIPACKAGE *package, IStorage *storage, MSIPATCHINFO *patch )
{
- static const WCHAR delete_query[] = {
- 'D','E','L','E','T','E',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
- 'W','H','E','R','E',' ','`','D','i','s','k','I','d','`','=','?',0};
- static const WCHAR insert_query[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ','`','M','e','d','i','a','`',' ',
- '(','`','D','i','s','k','I','d','`',',','`','L','a','s','t','S','e','q','u','e','n','c','e','`',',',
- '`','D','i','s','k','P','r','o','m','p','t','`',',','`','C','a','b','i','n','e','t','`',',',
- '`','V','o','l','u','m','e','L','a','b','e','l','`',',','`','S','o','u','r','c','e','`',')',' ',
- 'V','A','L','U','E','S',' ','(','?',',','?',',','?',',','?',',','?',',','?',')',0};
MSIQUERY *view;
MSIRECORD *rec;
UINT r, disk_id;
@@ -708,10 +669,11 @@ static UINT patch_add_media( MSIPACKAGE *package, IStorage *storage, MSIPATCHINF
msiobj_release( &rec->hdr );
continue;
}
- if (!(media = msi_alloc( sizeof( *media )))) {
+ if (!(media = msi_alloc( sizeof( *media ))))
+ {
msiobj_release( &rec->hdr );
goto done;
- }
+ }
media->disk_id = disk_id;
media->last_sequence = MSI_RecordGetInteger( rec, 2 );
media->prompt = msi_dup_record_field( rec, 3 );
@@ -726,7 +688,7 @@ static UINT patch_add_media( MSIPACKAGE *package, IStorage *storage, MSIPATCHINF
{
MSIQUERY *delete_view, *insert_view;
- r = MSI_DatabaseOpenViewW( package->db, delete_query, &delete_view );
+ r = MSI_DatabaseOpenViewW( package->db, L"DELETE FROM `Media` WHERE `DiskId`=?", &delete_view );
if (r != ERROR_SUCCESS) goto done;
rec = MSI_CreateRecord( 1 );
@@ -737,7 +699,9 @@ static UINT patch_add_media( MSIPACKAGE *package, IStorage *storage, MSIPATCHINF
msiobj_release( &rec->hdr );
if (r != ERROR_SUCCESS) goto done;
- r = MSI_DatabaseOpenViewW( package->db, insert_query, &insert_view );
+ r = MSI_DatabaseOpenViewW( package->db, L"INSERT INTO `Media` (`DiskId`,`LastSequence`,`DiskPrompt`,"
+ L"`Cabinet`,`VolumeLabel`,`Source`) VALUES (?,?,?,?,?,?)",
+ &insert_view );
if (r != ERROR_SUCCESS) goto done;
disk_id = package->db->media_transform_disk_id;
@@ -842,17 +806,12 @@ done:
static DWORD is_uninstallable( MSIDATABASE *db )
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','`','V','a','l','u','e','`',' ','F','R','O','M',' ',
- '`','M','s','i','P','a','t','c','h','M','e','t','a','d','a','t','a','`',' ',
- 'W','H','E','R','E',' ','`','C','o','m','p','a','n','y','`',' ','I','S',' ',
- 'N','U','L','L',' ','A','N','D',' ','`','P','r','o','p','e','r','t','y','`','=',
- '\'','A','l','l','o','w','R','e','m','o','v','a','l','\'',0};
MSIQUERY *view;
MSIRECORD *rec;
DWORD ret = 0;
- if (MSI_DatabaseOpenViewW( db, query, &view ) != ERROR_SUCCESS) return 0;
+ if (MSI_DatabaseOpenViewW( db, L"SELECT `Value` FROM `MsiPatchMetadata` WHERE `Company` IS NULL "
+ L"AND `Property`='AllowRemoval'", &view ) != ERROR_SUCCESS) return 0;
if (MSI_ViewExecute( view, 0 ) != ERROR_SUCCESS)
{
msiobj_release( &view->hdr );
@@ -915,7 +874,6 @@ void msi_free_patchinfo( MSIPATCHINFO *patch )
static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
{
- static const WCHAR dotmsp[] = {'.','m','s','p',0};
MSIDATABASE *patch_db = NULL;
WCHAR localfile[MAX_PATH];
MSISUMMARYINFO *si;
@@ -947,7 +905,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
if ( r != ERROR_SUCCESS )
goto done;
- r = msi_create_empty_local_file( localfile, dotmsp );
+ r = msi_create_empty_local_file( localfile, L".msp" );
if ( r != ERROR_SUCCESS )
goto done;
@@ -976,7 +934,7 @@ UINT msi_apply_patches( MSIPACKAGE *package )
LPWSTR patch_list, *patches;
UINT i, r = ERROR_SUCCESS;
- patch_list = msi_dup_property( package->db, szPatch );
+ patch_list = msi_dup_property( package->db, L"PATCH" );
TRACE("patches to be applied: %s\n", debugstr_w(patch_list));
@@ -991,11 +949,10 @@ UINT msi_apply_patches( MSIPACKAGE *package )
UINT msi_apply_transforms( MSIPACKAGE *package )
{
- static const WCHAR szTransforms[] = {'T','R','A','N','S','F','O','R','M','S',0};
LPWSTR xform_list, *xforms;
UINT i, r = ERROR_SUCCESS;
- xform_list = msi_dup_property( package->db, szTransforms );
+ xform_list = msi_dup_property( package->db, L"TRANSFORMS" );
xforms = msi_split_string( xform_list, ';' );
for (i = 0; xforms && xforms[i] && r == ERROR_SUCCESS; i++)
diff --git a/dlls/msi/record.c b/dlls/msi/record.c
index 0a352adcd87..46c2d71f6f1 100644
--- a/dlls/msi/record.c
+++ b/dlls/msi/record.c
@@ -147,7 +147,7 @@ static BOOL string2intW( LPCWSTR str, int *out )
if( str[0] == '-' ) /* check if it's negative */
x = -x;
- *out = x;
+ *out = x;
return TRUE;
}
@@ -439,7 +439,6 @@ const WCHAR *MSI_RecordGetString( const MSIRECORD *rec, UINT iField )
UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField,
LPWSTR szValue, LPDWORD pcchValue)
{
- static const WCHAR szFormat[] = {'%','d',0};
UINT len = 0, ret = ERROR_SUCCESS;
WCHAR buffer[16];
@@ -457,7 +456,7 @@ UINT MSI_RecordGetStringW(MSIRECORD *rec, UINT iField,
switch( rec->fields[iField].type )
{
case MSIFIELD_INT:
- wsprintfW(buffer, szFormat, rec->fields[iField].u.iVal);
+ wsprintfW(buffer, L"%d", rec->fields[iField].u.iVal);
len = lstrlenW( buffer );
if (szValue)
lstrcpynW(szValue, buffer, *pcchValue);
diff --git a/dlls/msi/script.c b/dlls/msi/script.c
index 67ad8b51c52..4585c2b5922 100644
--- a/dlls/msi/script.c
+++ b/dlls/msi/script.c
@@ -49,10 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#endif
-static const WCHAR szJScript[] = { 'J','S','c','r','i','p','t',0};
-static const WCHAR szVBScript[] = { 'V','B','S','c','r','i','p','t',0};
-static const WCHAR szSession[] = {'S','e','s','s','i','o','n',0};
-
/*
* MsiActiveScriptSite - Our IActiveScriptSite implementation.
*/
@@ -135,7 +131,7 @@ static HRESULT WINAPI MsiActiveScriptSite_GetItemInfo(IActiveScriptSite* iface,
}
/* Are we looking for the session object? */
- if (!wcscmp(szSession, pstrName)) {
+ if (!wcscmp(L"Session", pstrName)) {
if (dwReturnMask & SCRIPTINFO_ITYPEINFO) {
HRESULT hr = get_typeinfo(Session_tid, ppti);
if (SUCCEEDED(hr))
@@ -319,9 +315,9 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
/* Create the scripting engine */
type &= msidbCustomActionTypeJScript|msidbCustomActionTypeVBScript;
if (type == msidbCustomActionTypeJScript)
- hr = CLSIDFromProgID(szJScript, &clsid);
+ hr = CLSIDFromProgID(L"JScript", &clsid);
else if (type == msidbCustomActionTypeVBScript)
- hr = CLSIDFromProgID(szVBScript, &clsid);
+ hr = CLSIDFromProgID(L"VBScript", &clsid);
else {
ERR("Unknown script type %d\n", type);
goto done;
@@ -345,7 +341,7 @@ DWORD call_script(MSIHANDLE hPackage, INT type, LPCWSTR script, LPCWSTR function
hr = IActiveScriptParse_InitNew(pActiveScriptParse);
if (FAILED(hr)) goto done;
- hr = IActiveScript_AddNamedItem(pActiveScript, szSession, SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
+ hr = IActiveScript_AddNamedItem(pActiveScript, L"Session", SCRIPTITEM_GLOBALMEMBERS|SCRIPTITEM_ISVISIBLE);
if (FAILED(hr)) goto done;
hr = IActiveScriptParse_ParseScriptText(pActiveScriptParse, script, NULL, NULL, NULL, 0, 0, 0L, NULL, NULL);
diff --git a/dlls/msi/select.c b/dlls/msi/select.c
index 3c643f37239..d5a8e1fde23 100644
--- a/dlls/msi/select.c
+++ b/dlls/msi/select.c
@@ -236,10 +236,10 @@ static UINT SELECT_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *na
n = sv->cols[ n - 1 ];
if( !n )
{
- if (name) *name = szEmpty;
+ if (name) *name = L"";
if (type) *type = MSITYPE_UNKNOWN | MSITYPE_VALID;
if (temporary) *temporary = FALSE;
- if (table_name) *table_name = szEmpty;
+ if (table_name) *table_name = L"";
return ERROR_SUCCESS;
}
return sv->table->ops->get_column_info( sv->table, n, name,
@@ -404,7 +404,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name,
}
sv->cols[sv->num_cols] = n;
- TRACE("Translating column %s from %d -> %d\n",
+ TRACE("Translating column %s from %d -> %d\n",
debugstr_w( name ), sv->num_cols, n);
sv->num_cols++;
@@ -433,7 +433,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
sv = msi_alloc_zero( FIELD_OFFSET( MSISELECTVIEW, cols[count] ));
if( !sv )
return ERROR_FUNCTION_FAILED;
-
+
/* fill the structure */
sv->view.ops = &select_ops;
sv->db = db;
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index 89c04d9f7dd..b4b3b54fe35 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -53,7 +53,7 @@ typedef struct tagMediaInfo
static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions,
MSIINSTALLCONTEXT context, BOOL create)
{
- HKEY rootkey = 0;
+ HKEY rootkey = 0;
UINT rc = ERROR_FUNCTION_FAILED;
if (context == MSIINSTALLCONTEXT_USERUNMANAGED)
@@ -90,10 +90,10 @@ static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions,
}
if (create)
- rc = RegCreateKeyW(rootkey, szSourceList, key);
+ rc = RegCreateKeyW(rootkey, L"SourceList", key);
else
{
- rc = RegOpenKeyW(rootkey,szSourceList, key);
+ rc = RegOpenKeyW(rootkey, L"SourceList", key);
if (rc != ERROR_SUCCESS)
rc = ERROR_BAD_CONFIGURATION;
}
@@ -105,12 +105,11 @@ static UINT OpenSourceKey(LPCWSTR szProduct, HKEY* key, DWORD dwOptions,
static UINT OpenMediaSubkey(HKEY rootkey, HKEY *key, BOOL create)
{
UINT rc;
- static const WCHAR media[] = {'M','e','d','i','a',0};
if (create)
- rc = RegCreateKeyW(rootkey, media, key);
+ rc = RegCreateKeyW(rootkey, L"Media", key);
else
- rc = RegOpenKeyW(rootkey,media, key);
+ rc = RegOpenKeyW(rootkey, L"Media", key);
return rc;
}
@@ -118,12 +117,11 @@ static UINT OpenMediaSubkey(HKEY rootkey, HKEY *key, BOOL create)
static UINT OpenNetworkSubkey(HKEY rootkey, HKEY *key, BOOL create)
{
UINT rc;
- static const WCHAR net[] = {'N','e','t',0};
if (create)
- rc = RegCreateKeyW(rootkey, net, key);
+ rc = RegCreateKeyW(rootkey, L"Net", key);
else
- rc = RegOpenKeyW(rootkey, net, key);
+ rc = RegOpenKeyW(rootkey, L"Net", key);
return rc;
}
@@ -131,12 +129,11 @@ static UINT OpenNetworkSubkey(HKEY rootkey, HKEY *key, BOOL create)
static UINT OpenURLSubkey(HKEY rootkey, HKEY *key, BOOL create)
{
UINT rc;
- static const WCHAR URL[] = {'U','R','L',0};
if (create)
- rc = RegCreateKeyW(rootkey, URL, key);
+ rc = RegCreateKeyW(rootkey, L"URL", key);
else
- rc = RegOpenKeyW(rootkey, URL, key);
+ rc = RegOpenKeyW(rootkey, L"URL", key);
return rc;
}
@@ -208,7 +205,6 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
LPWSTR szVolumeLabel, LPDWORD pcchVolumeLabel,
LPWSTR szDiskPrompt, LPDWORD pcchDiskPrompt)
{
- static const WCHAR fmt[] = {'#','%','d',0};
WCHAR squashed_pc[SQUASHED_GUID_SIZE], convert[11];
WCHAR *value = NULL, *data = NULL, *ptr, *ptr2;
HKEY source, media;
@@ -285,7 +281,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
{
if (type == REG_DWORD)
{
- swprintf(convert, ARRAY_SIZE(convert), fmt, *data);
+ swprintf(convert, ARRAY_SIZE(convert), L"#%d", *data);
size = lstrlenW(convert);
ptr2 = convert;
}
@@ -307,7 +303,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode,
if (type == REG_DWORD)
{
- swprintf(convert, ARRAY_SIZE(convert), fmt, *ptr);
+ swprintf(convert, ARRAY_SIZE(convert), L"#%d", *ptr);
size = lstrlenW(convert);
ptr = convert;
}
@@ -412,7 +408,6 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs
DWORD dwOptions, DWORD dwIndex,
LPWSTR szSource, LPDWORD pcchSource)
{
- static const WCHAR format[] = {'%','d',0};
WCHAR squashed_pc[SQUASHED_GUID_SIZE], name[32];
HKEY source = NULL, subkey = NULL;
LONG res;
@@ -458,7 +453,7 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs
goto done;
}
- swprintf(name, ARRAY_SIZE(name), format, dwIndex + 1);
+ swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex + 1);
res = RegQueryValueExW(subkey, name, 0, 0, (LPBYTE)szSource, pcchSource);
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
@@ -536,10 +531,9 @@ done:
*/
UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
MSIINSTALLCONTEXT dwContext, DWORD dwOptions,
- LPCWSTR szProperty, LPWSTR szValue,
- LPDWORD pcchValue)
+ LPCWSTR szProperty, LPWSTR szValue,
+ LPDWORD pcchValue)
{
- static const WCHAR mediapack[] = {'M','e','d','i','a','P','a','c','k','a','g','e',0};
WCHAR *source, *ptr, squashed_pc[SQUASHED_GUID_SIZE];
HKEY sourcekey, media;
DWORD size;
@@ -579,7 +573,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
}
if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ))
- szProperty = mediapack;
+ szProperty = L"MediaPackage";
RegQueryValueExW(media, szProperty, 0, 0, (LPBYTE)szValue, pcchValue);
RegCloseKey(media);
@@ -591,7 +585,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
0, 0, NULL, &size);
if (rc != ERROR_SUCCESS)
{
- static WCHAR szEmpty[1] = { '\0' };
+ static WCHAR szEmpty[] = {0};
rc = ERROR_SUCCESS;
source = NULL;
ptr = szEmpty;
@@ -709,8 +703,6 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
UINT r;
int index = 1;
- static const WCHAR format[] = {'%','c',';','%','i',';','%','s',0};
-
if (options & MSISOURCETYPE_NETWORK)
typechar = 'n';
else if (options & MSISOURCETYPE_URL)
@@ -736,7 +728,7 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
return r;
}
- size = lstrlenW(format) + lstrlenW(value) + 7;
+ size = lstrlenW(L"%c;%d;%s") + lstrlenW(value) + 7;
buffer = msi_alloc(size * sizeof(WCHAR));
if (!buffer)
return ERROR_OUTOFMEMORY;
@@ -748,7 +740,7 @@ UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
return r;
}
- swprintf(buffer, size, format, typechar, index, value);
+ swprintf(buffer, size, L"%c;%d;%s", typechar, index, value);
size = (lstrlenW(buffer) + 1) * sizeof(WCHAR);
r = RegSetValueExW(source, INSTALLPROPERTY_LASTUSEDSOURCEW, 0,
@@ -766,7 +758,6 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
MSIINSTALLCONTEXT dwContext, DWORD dwOptions,
LPCWSTR szProperty, LPCWSTR szValue)
{
- static const WCHAR media_package[] = {'M','e','d','i','a','P','a','c','k','a','g','e',0};
WCHAR squashed_pc[SQUASHED_GUID_SIZE];
HKEY sourcekey, media;
LPCWSTR property;
@@ -795,7 +786,7 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
property = szProperty;
if (!wcscmp( szProperty, INSTALLPROPERTY_MEDIAPACKAGEPATHW ))
- property = media_package;
+ property = L"MediaPackage";
rc = OpenSourceKey(szProduct, &sourcekey, MSICODE_PRODUCT, dwContext, FALSE);
if (rc != ERROR_SUCCESS)
@@ -896,7 +887,7 @@ UINT WINAPI MsiSourceListAddSourceW( LPCWSTR szProduct, LPCWSTR szUserName,
RegCloseKey(hkey);
}
- ret = MsiSourceListAddSourceExW(szProduct, sidstr,
+ ret = MsiSourceListAddSourceExW(szProduct, sidstr,
context, MSISOURCETYPE_NETWORK, szSource, 0);
if (sidstr)
@@ -968,7 +959,6 @@ static void add_source_to_list(struct list *sourcelist, media_info *info,
{
media_info *iter;
BOOL found = FALSE;
- static const WCHAR fmt[] = {'%','i',0};
if (index) *index = 0;
@@ -988,7 +978,7 @@ static void add_source_to_list(struct list *sourcelist, media_info *info,
/* update the rest of the list */
if (found)
- swprintf(iter->szIndex, ARRAY_SIZE(iter->szIndex), fmt, ++iter->index);
+ swprintf(iter->szIndex, ARRAY_SIZE(iter->szIndex), L"%d", ++iter->index);
else if (index)
(*index)++;
}
@@ -1052,10 +1042,9 @@ error:
* MsiSourceListAddSourceExW (MSI.@)
*/
UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
- MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szSource,
+ MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szSource,
DWORD dwIndex)
{
- static const WCHAR fmt[] = {'%','i',0};
HKEY sourcekey, typekey;
UINT rc;
struct list sourcelist;
@@ -1108,7 +1097,7 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
return rc;
}
- postfix = (dwOptions & MSISOURCETYPE_NETWORK) ? szBackSlash : szForwardSlash;
+ postfix = (dwOptions & MSISOURCETYPE_NETWORK) ? L"\\" : L"/";
if (szSource[lstrlenW(szSource) - 1] == *postfix)
source = strdupW(szSource);
else
@@ -1128,18 +1117,18 @@ UINT WINAPI MsiSourceListAddSourceExW( LPCWSTR szProduct, LPCWSTR szUserSid,
if (count == 0)
{
- rc = RegSetValueExW(typekey, szOne, 0, REG_EXPAND_SZ, (LPBYTE)source, size);
+ rc = RegSetValueExW(typekey, L"1", 0, REG_EXPAND_SZ, (LPBYTE)source, size);
goto done;
}
else if (dwIndex > count || dwIndex == 0)
{
- swprintf(name, ARRAY_SIZE(name), fmt, count + 1);
+ swprintf(name, ARRAY_SIZE(name), L"%d", count + 1);
rc = RegSetValueExW(typekey, name, 0, REG_EXPAND_SZ, (LPBYTE)source, size);
goto done;
}
else
{
- swprintf(name, ARRAY_SIZE(name), fmt, dwIndex);
+ swprintf(name, ARRAY_SIZE(name), L"%d", dwIndex);
info = msi_alloc(sizeof(media_info));
if (!info)
{
@@ -1205,11 +1194,10 @@ UINT WINAPI MsiSourceListAddMediaDiskA(LPCSTR szProduct, LPCSTR szUserSid,
/******************************************************************
* MsiSourceListAddMediaDiskW (MSI.@)
*/
-UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
- MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId,
+UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
+ MSIINSTALLCONTEXT dwContext, DWORD dwOptions, DWORD dwDiskId,
LPCWSTR szVolumeLabel, LPCWSTR szDiskPrompt)
{
- static const WCHAR fmt[] = {'%','i',0};
HKEY sourcekey, mediakey;
UINT rc;
WCHAR *buffer, squashed_pc[SQUASHED_GUID_SIZE], szIndex[10];
@@ -1243,7 +1231,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
OpenMediaSubkey(sourcekey, &mediakey, TRUE);
- swprintf(szIndex, ARRAY_SIZE(szIndex), fmt, dwDiskId);
+ swprintf(szIndex, ARRAY_SIZE(szIndex), L"%d", dwDiskId);
size = 2;
if (szVolumeLabel) size += lstrlenW(szVolumeLabel);
@@ -1254,7 +1242,7 @@ UINT WINAPI MsiSourceListAddMediaDiskW(LPCWSTR szProduct, LPCWSTR szUserSid,
*buffer = '\0';
if (szVolumeLabel) lstrcpyW(buffer, szVolumeLabel);
- lstrcatW(buffer, szSemiColon);
+ lstrcatW(buffer, L";");
if (szDiskPrompt) lstrcatW(buffer, szDiskPrompt);
RegSetValueExW(mediakey, szIndex, 0, REG_SZ, (LPBYTE)buffer, size);
diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y
index 7bdace72981..5b5c8bd7f8e 100644
--- a/dlls/msi/sql.y
+++ b/dlls/msi/sql.y
@@ -740,7 +740,6 @@ number:
static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table )
{
- static const WCHAR space[] = {' ',0};
DWORD len = lstrlenW( list ) + lstrlenW( table ) + 2;
LPWSTR ret;
@@ -748,7 +747,7 @@ static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table )
if( ret )
{
lstrcpyW( ret, list );
- lstrcatW( ret, space );
+ lstrcatW( ret, L" " );
lstrcatW( ret, table );
}
return ret;
diff --git a/dlls/msi/storages.c b/dlls/msi/storages.c
index 521b6e89e83..336b40a3ae1 100644
--- a/dlls/msi/storages.c
+++ b/dlls/msi/storages.c
@@ -316,16 +316,16 @@ static UINT STORAGES_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *
switch (n)
{
case 1:
- if (name) *name = szName;
+ if (name) *name = L"Name";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STORAGES_NAME_LEN;
break;
case 2:
- if (name) *name = szData;
+ if (name) *name = L"Data";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE;
break;
}
- if (table_name) *table_name = szStorages;
+ if (table_name) *table_name = L"_Storages";
if (temporary) *temporary = FALSE;
return ERROR_SUCCESS;
}
diff --git a/dlls/msi/streams.c b/dlls/msi/streams.c
index 6f8a436b5e4..1ef99c2ab05 100644
--- a/dlls/msi/streams.c
+++ b/dlls/msi/streams.c
@@ -278,16 +278,16 @@ static UINT STREAMS_get_column_info( struct tagMSIVIEW *view, UINT n, LPCWSTR *n
switch (n)
{
case 1:
- if (name) *name = szName;
+ if (name) *name = L"Name";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MAX_STREAM_NAME_LEN;
break;
case 2:
- if (name) *name = szData;
+ if (name) *name = L"Data";
if (type) *type = MSITYPE_STRING | MSITYPE_VALID | MSITYPE_NULLABLE;
break;
}
- if (table_name) *table_name = szStreams;
+ if (table_name) *table_name = L"_Streams";
if (temporary) *temporary = FALSE;
return ERROR_SUCCESS;
}
@@ -614,7 +614,7 @@ UINT msi_commit_streams( MSIDATABASE *db )
for (i = 0; i < db->num_streams; i++)
{
name = msi_string_lookup( db->strings, db->streams[i].str_index, NULL );
- if (!wcscmp( name, szSumInfo )) continue;
+ if (!wcscmp( name, L"\5SummaryInformation" )) continue;
if (!(encname = encode_streamname( FALSE, name ))) return ERROR_OUTOFMEMORY;
TRACE("saving stream %s as %s\n", debugstr_w(name), debugstr_w(encname));
diff --git a/dlls/msi/string.c b/dlls/msi/string.c
index 5c6432ba1ed..0e250ff4527 100644
--- a/dlls/msi/string.c
+++ b/dlls/msi/string.c
@@ -77,7 +77,7 @@ static string_table *init_stringtable( int entries, UINT codepage )
st = msi_alloc( sizeof (string_table) );
if( !st )
- return NULL;
+ return NULL;
if( entries < 1 )
entries = 1;
@@ -85,7 +85,7 @@ static string_table *init_stringtable( int entries, UINT codepage )
if( !st->strings )
{
msi_free( st );
- return NULL;
+ return NULL;
}
st->sorted = msi_alloc( sizeof (UINT) * entries );
@@ -347,7 +347,7 @@ const WCHAR *msi_string_lookup( const string_table *st, UINT id, int *len )
if( id == 0 )
{
if (len) *len = 0;
- return szEmpty;
+ return L"";
}
if( id >= st->maxcount )
return NULL;
@@ -465,12 +465,12 @@ HRESULT msi_init_string_table( IStorage *stg )
UINT ret;
/* create the StringPool stream... add the zero string to it*/
- ret = write_stream_data(stg, szStringPool, zero, sizeof zero, TRUE);
+ ret = write_stream_data(stg, L"_StringPool", zero, sizeof zero, TRUE);
if (ret != ERROR_SUCCESS)
return E_FAIL;
/* create the StringData stream... make it zero length */
- ret = write_stream_data(stg, szStringData, NULL, 0, TRUE);
+ ret = write_stream_data(stg, L"_StringData", NULL, 0, TRUE);
if (ret != ERROR_SUCCESS)
return E_FAIL;
@@ -485,10 +485,10 @@ string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref )
UINT r, datasize = 0, poolsize = 0, codepage;
DWORD i, count, offset, len, n, refs;
- r = read_stream_data( stg, szStringPool, TRUE, (BYTE **)&pool, &poolsize );
+ r = read_stream_data( stg, L"_StringPool", TRUE, (BYTE **)&pool, &poolsize );
if( r != ERROR_SUCCESS)
goto end;
- r = read_stream_data( stg, szStringData, TRUE, (BYTE **)&data, &datasize );
+ r = read_stream_data( stg, L"_StringData", TRUE, (BYTE **)&data, &datasize );
if( r != ERROR_SUCCESS)
goto end;
@@ -652,11 +652,11 @@ UINT msi_save_string_table( const string_table *st, IStorage *storage, UINT *byt
}
/* write the streams */
- r = write_stream_data( storage, szStringData, data, datasize, TRUE );
+ r = write_stream_data( storage, L"_StringData", data, datasize, TRUE );
TRACE("Wrote StringData r=%08x\n", r);
if( r )
goto err;
- r = write_stream_data( storage, szStringPool, pool, poolsize, TRUE );
+ r = write_stream_data( storage, L"_StringPool", pool, poolsize, TRUE );
TRACE("Wrote StringPool r=%08x\n", r);
if( r )
goto err;
diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index 94983cb86d9..19317713a3c 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -44,7 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
#include "pshpack1.h"
-typedef struct {
+typedef struct {
WORD wByteOrder;
WORD wFormat;
DWORD dwOSVer;
@@ -52,20 +52,20 @@ typedef struct {
DWORD reserved;
} PROPERTYSETHEADER;
-typedef struct {
+typedef struct {
FMTID fmtid;
DWORD dwOffset;
} FORMATIDOFFSET;
-typedef struct {
+typedef struct {
DWORD cbSection;
DWORD cProperties;
-} PROPERTYSECTIONHEADER;
-
-typedef struct {
+} PROPERTYSECTIONHEADER;
+
+typedef struct {
DWORD propid;
DWORD dwOffset;
-} PROPERTYIDOFFSET;
+} PROPERTYIDOFFSET;
typedef struct {
DWORD type;
@@ -79,7 +79,7 @@ typedef struct {
} str;
} u;
} PROPERTY_DATA;
-
+
#include "poppack.h"
static HRESULT (WINAPI *pPropVariantChangeType)
@@ -452,7 +452,7 @@ UINT msi_get_suminfo( IStorage *stg, UINT uiUpdateCount, MSISUMMARYINFO **ret )
if (!(si = create_suminfo( stg, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
- hr = IStorage_OpenStream( si->storage, szSumInfo, 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
+ hr = IStorage_OpenStream( si->storage, L"\5SummaryInformation", 0, STGM_READ|STGM_SHARE_EXCLUSIVE, 0, &stm );
if (FAILED( hr ))
{
msiobj_release( &si->hdr );
@@ -479,7 +479,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r
if (!(si = create_suminfo( db->storage, uiUpdateCount ))) return ERROR_OUTOFMEMORY;
- r = msi_get_stream( db, szSumInfo, &stm );
+ r = msi_get_stream( db, L"\5SummaryInformation", &stm );
if (r != ERROR_SUCCESS)
{
msiobj_release( &si->hdr );
@@ -498,7 +498,7 @@ UINT msi_get_db_suminfo( MSIDATABASE *db, UINT uiUpdateCount, MSISUMMARYINFO **r
return ERROR_SUCCESS;
}
-UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
+UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
LPCWSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle )
{
MSISUMMARYINFO *si;
@@ -569,7 +569,7 @@ UINT WINAPI MsiGetSummaryInformationW( MSIHANDLE hDatabase,
return ret;
}
-UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase,
+UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase,
LPCSTR szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
{
LPWSTR szwDatabase = NULL;
@@ -965,7 +965,7 @@ static UINT suminfo_persist( MSISUMMARYINFO *si )
HRESULT r;
grfMode = STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
- r = IStorage_CreateStream( si->storage, szSumInfo, grfMode, 0, 0, &stm );
+ r = IStorage_CreateStream( si->storage, L"\5SummaryInformation", grfMode, 0, 0, &stm );
if( SUCCEEDED(r) )
{
ret = save_summary_info( si, stm );
@@ -1244,7 +1244,6 @@ UINT WINAPI MsiCreateTransformSummaryInfoW( MSIHANDLE db, MSIHANDLE db_ref, LPCW
UINT msi_load_suminfo_properties( MSIPACKAGE *package )
{
- static const WCHAR packagecodeW[] = {'P','a','c','k','a','g','e','C','o','d','e',0};
MSISUMMARYINFO *si;
WCHAR *package_code;
UINT r, len;
@@ -1285,7 +1284,7 @@ UINT msi_load_suminfo_properties( MSIPACKAGE *package )
return r;
}
- r = msi_set_property( package->db, packagecodeW, package_code, len );
+ r = msi_set_property( package->db, L"PackageCode", package_code, len );
msi_free( package_code );
count = 0;
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index e9d6e8804e7..bfddd6125e9 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -71,21 +71,15 @@ struct tagMSITABLE
};
/* information for default tables */
-static const WCHAR szTables[] = {'_','T','a','b','l','e','s',0};
-static const WCHAR szTable[] = {'T','a','b','l','e',0};
-static const WCHAR szColumns[] = {'_','C','o','l','u','m','n','s',0};
-static const WCHAR szNumber[] = {'N','u','m','b','e','r',0};
-static const WCHAR szType[] = {'T','y','p','e',0};
-
static const MSICOLUMNINFO _Columns_cols[4] = {
- { szColumns, 1, szTable, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
- { szColumns, 2, szNumber, MSITYPE_VALID | MSITYPE_KEY | 2, 2, NULL },
- { szColumns, 3, szName, MSITYPE_VALID | MSITYPE_STRING | 64, 4, NULL },
- { szColumns, 4, szType, MSITYPE_VALID | 2, 6, NULL },
+ { L"_Columns", 1, L"Table", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
+ { L"_Columns", 2, L"Number", MSITYPE_VALID | MSITYPE_KEY | 2, 2, NULL },
+ { L"_Columns", 3, L"Name", MSITYPE_VALID | MSITYPE_STRING | 64, 4, NULL },
+ { L"_Columns", 4, L"Type", MSITYPE_VALID | 2, 6, NULL },
};
static const MSICOLUMNINFO _Tables_cols[1] = {
- { szTables, 1, szName, MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
+ { L"_Tables", 1, L"Name", MSITYPE_VALID | MSITYPE_STRING | MSITYPE_KEY | 64, 0, NULL },
};
#define MAX_STREAM_NAME 0x1f
@@ -138,7 +132,7 @@ LPWSTR encode_streamname(BOOL bTable, LPCWSTR in)
*p++ = 0x4840;
count --;
}
- while( count -- )
+ while( count -- )
{
ch = *in++;
if( !ch )
@@ -251,7 +245,7 @@ UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
TRACE("%s -> %s\n",debugstr_w(stname),debugstr_w(encname));
- r = IStorage_OpenStream(stg, encname, NULL,
+ r = IStorage_OpenStream(stg, encname, NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm);
msi_free( encname );
if( FAILED( r ) )
@@ -272,7 +266,7 @@ UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
WARN("Too big!\n");
goto end;
}
-
+
sz = stat.cbSize.QuadPart;
data = msi_alloc( sz );
if( !data )
@@ -281,7 +275,7 @@ UINT read_stream_data( IStorage *stg, LPCWSTR stname, BOOL table,
ret = ERROR_NOT_ENOUGH_MEMORY;
goto end;
}
-
+
r = IStream_Read(stm, data, sz, &count );
if( FAILED( r ) || ( count != sz ) )
{
@@ -312,7 +306,7 @@ UINT write_stream_data( IStorage *stg, LPCWSTR stname,
LPWSTR encname;
encname = encode_streamname(bTable, stname );
- r = IStorage_OpenStream( stg, encname, NULL,
+ r = IStorage_OpenStream( stg, encname, NULL,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, &stm);
if( FAILED(r) )
{
@@ -520,12 +514,12 @@ static UINT get_defaulttablecolumns( MSIDATABASE *db, LPCWSTR name, MSICOLUMNINF
TRACE("%s\n", debugstr_w(name));
- if (!wcscmp( name, szTables ))
+ if (!wcscmp( name, L"_Tables" ))
{
p = _Tables_cols;
n = 1;
}
- else if (!wcscmp( name, szColumns ))
+ else if (!wcscmp( name, L"_Columns" ))
{
p = _Columns_cols;
n = 4;
@@ -603,7 +597,7 @@ static UINT get_table( MSIDATABASE *db, LPCWSTR name, MSITABLE **table_ret )
table->persistent = MSICONDITION_TRUE;
lstrcpyW( table->name, name );
- if (!wcscmp( name, szTables ) || !wcscmp( name, szColumns ))
+ if (!wcscmp( name, L"_Tables" ) || !wcscmp( name, L"_Columns" ))
table->persistent = MSICONDITION_NONE;
r = table_get_column_info( db, name, &table->colinfo, &table->col_count );
@@ -645,7 +639,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
if (r == ERROR_SUCCESS && *sz)
return r;
- r = get_table( db, szColumns, &table );
+ r = get_table( db, L"_Columns", &table );
if (r != ERROR_SUCCESS)
{
ERR("couldn't load _Columns table\n");
@@ -766,7 +760,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
}
table_calc_column_offsets( db, table->colinfo, table->col_count);
- r = TABLE_CreateView( db, szTables, &tv );
+ r = TABLE_CreateView( db, L"_Tables", &tv );
TRACE("CreateView returned %x\n", r);
if( r )
{
@@ -801,7 +795,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
if( persistent != MSICONDITION_FALSE )
{
/* add each column to the _Columns table */
- r = TABLE_CreateView( db, szColumns, &tv );
+ r = TABLE_CreateView( db, L"_Columns", &tv );
if( r )
goto err;
@@ -969,8 +963,8 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
UINT r, table_id, i;
MSITABLE *table;
- if( !wcscmp( name, szTables ) || !wcscmp( name, szColumns ) ||
- !wcscmp( name, szStreams ) || !wcscmp( name, szStorages ) )
+ if( !wcscmp( name, L"_Tables" ) || !wcscmp( name, L"_Columns" ) ||
+ !wcscmp( name, L"_Streams" ) || !wcscmp( name, L"_Storages" ) )
return TRUE;
r = msi_string2id( db->strings, name, -1, &table_id );
@@ -980,10 +974,10 @@ BOOL TABLE_Exists( MSIDATABASE *db, LPCWSTR name )
return FALSE;
}
- r = get_table( db, szTables, &table );
+ r = get_table( db, L"_Tables", &table );
if( r != ERROR_SUCCESS )
{
- ERR("table %s not available\n", debugstr_w(szTables));
+ ERR("table _Tables not available\n");
return FALSE;
}
@@ -1088,16 +1082,15 @@ static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname )
}
else
{
- static const WCHAR fmt[] = { '%','d',0 };
UINT n = bytes_per_column( tv->db, &tv->columns[i], LONG_STR_BYTES );
switch( n )
{
case 2:
- swprintf( number, ARRAY_SIZE(number), fmt, ival-0x8000 );
+ swprintf( number, ARRAY_SIZE(number), L"%d", ival-0x8000 );
break;
case 4:
- swprintf( number, ARRAY_SIZE(number), fmt, ival^0x80000000 );
+ swprintf( number, ARRAY_SIZE(number), L"%d", ival^0x80000000 );
break;
default:
ERR( "oops - unknown column width %d\n", n );
@@ -1107,7 +1100,7 @@ static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname )
sval = number;
}
- len += lstrlenW( szDot ) + lstrlenW( sval );
+ len += lstrlenW( L"." ) + lstrlenW( sval );
p = msi_realloc ( stname, len*sizeof(WCHAR) );
if ( !p )
{
@@ -1116,7 +1109,7 @@ static UINT get_stream_name( const MSITABLEVIEW *tv, UINT row, WCHAR **pstname )
}
stname = p;
- lstrcatW( stname, szDot );
+ lstrcatW( stname, L"." );
lstrcatW( stname, sval );
}
else
@@ -1295,15 +1288,6 @@ static UINT TABLE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec )
static UINT add_stream( MSIDATABASE *db, const WCHAR *name, IStream *data )
{
- static const WCHAR insert[] = {
- 'I','N','S','E','R','T',' ','I','N','T','O',' ',
- '`','_','S','t','r','e','a','m','s','`',' ',
- '(','`','N','a','m','e','`',',','`','D','a','t','a','`',')',' ',
- 'V','A','L','U','E','S',' ','(','?',',','?',')',0};
- static const WCHAR update[] = {
- 'U','P','D','A','T','E',' ','`','_','S','t','r','e','a','m','s','`',' ',
- 'S','E','T',' ','`','D','a','t','a','`',' ','=',' ','?',' ',
- 'W','H','E','R','E',' ','`','N','a','m','e','`',' ','=',' ','?',0};
MSIQUERY *query;
MSIRECORD *rec;
UINT r;
@@ -1321,7 +1305,7 @@ static UINT add_stream( MSIDATABASE *db, const WCHAR *name, IStream *data )
if (r != ERROR_SUCCESS)
goto done;
- r = MSI_DatabaseOpenViewW( db, insert, &query );
+ r = MSI_DatabaseOpenViewW( db, L"INSERT INTO `_Streams` (`Name`,`Data`) VALUES (?,?)", &query );
if (r != ERROR_SUCCESS)
goto done;
@@ -1342,7 +1326,7 @@ static UINT add_stream( MSIDATABASE *db, const WCHAR *name, IStream *data )
if (r != ERROR_SUCCESS)
goto done;
- r = MSI_DatabaseOpenViewW( db, update, &query );
+ r = MSI_DatabaseOpenViewW( db, L"UPDATE `_Streams` SET `Data` = ? WHERE `Name` = ?", &query );
if (r != ERROR_SUCCESS)
goto done;
@@ -1560,7 +1544,7 @@ static UINT TABLE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
static UINT TABLE_close( struct tagMSIVIEW *view )
{
TRACE("%p\n", view );
-
+
return ERROR_SUCCESS;
}
@@ -1977,7 +1961,7 @@ static UINT TABLE_remove_column(struct tagMSIVIEW *view, UINT number)
MSI_RecordSetStringW(rec, 1, tv->name);
MSI_RecordSetInteger(rec, 2, number);
- r = TABLE_CreateView(tv->db, szColumns, &columns);
+ r = TABLE_CreateView(tv->db, L"_Columns", &columns);
if (r != ERROR_SUCCESS)
{
msiobj_release(&rec->hdr);
@@ -2110,7 +2094,7 @@ static UINT TABLE_add_column(struct tagMSIVIEW *view, LPCWSTR column,
MSI_RecordSetStringW(rec, 3, column);
MSI_RecordSetInteger(rec, 4, type);
- r = TABLE_CreateView(tv->db, szColumns, &columns);
+ r = TABLE_CreateView(tv->db, L"_Columns", &columns);
if (r != ERROR_SUCCESS)
{
tv->table->col_count--;
@@ -2155,7 +2139,7 @@ static UINT TABLE_drop(struct tagMSIVIEW *view)
MSI_RecordSetStringW(rec, 1, tv->name);
- r = TABLE_CreateView(tv->db, szTables, &tables);
+ r = TABLE_CreateView(tv->db, L"_Tables", &tables);
if (r != ERROR_SUCCESS)
{
msiobj_release(&rec->hdr);
@@ -2210,9 +2194,9 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view )
TRACE("%p %s %p\n", db, debugstr_w(name), view );
- if ( !wcscmp( name, szStreams ) )
+ if ( !wcscmp( name, L"_Streams" ) )
return STREAMS_CreateView( db, view );
- else if ( !wcscmp( name, szStorages ) )
+ else if ( !wcscmp( name, L"_Storages" ) )
return STORAGES_CreateView( db, view );
sz = FIELD_OFFSET( MSITABLEVIEW, name[lstrlenW( name ) + 1] );
@@ -2345,13 +2329,13 @@ static UINT TransformView_set_row( MSIVIEW *view, UINT row, MSIRECORD *rec, UINT
WCHAR *key;
UINT i, p, r, len, qlen;
- if (!wcscmp( tv->name, szColumns ))
+ if (!wcscmp( tv->name, L"_Columns" ))
{
ERR( "trying to modify existing column\n" );
return ERROR_INSTALL_TRANSFORM_FAILURE;
}
- if (!wcscmp( tv->name, szTables ))
+ if (!wcscmp( tv->name, L"_Tables" ))
{
ERR( "trying to modify existing table\n" );
return ERROR_INSTALL_TRANSFORM_FAILURE;
@@ -2578,10 +2562,10 @@ static UINT TransformView_insert_row( MSIVIEW *view, MSIRECORD *rec, UINT row, B
int len;
UINT r;
- if (!wcscmp(tv->name, szTables))
+ if (!wcscmp(tv->name, L"_Tables"))
return TransformView_create_table( tv, rec );
- if (!wcscmp(tv->name, szColumns))
+ if (!wcscmp(tv->name, L"_Columns"))
return TransformView_add_column( tv, rec );
key = create_key_string( tv, rec );
@@ -2671,13 +2655,13 @@ static UINT TransformView_delete_row( MSIVIEW *view, UINT row )
MSIRECORD *rec;
MSIQUERY *q;
- if (!wcscmp( tv->name, szColumns ))
+ if (!wcscmp( tv->name, L"_Columns" ))
{
ERR("trying to remove column\n");
return ERROR_INSTALL_TRANSFORM_FAILURE;
}
- if (!wcscmp( tv->name, szTables ))
+ if (!wcscmp( tv->name, L"_Tables" ))
return TransformView_drop_table( tv, row );
r = msi_view_get_row( tv->db, view, row, &rec );
@@ -3296,7 +3280,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
UINT number = MSI_NULL_INTEGER;
UINT row = 0;
- if (!wcscmp( name, szColumns ))
+ if (!wcscmp( name, L"_Columns" ))
{
MSI_RecordGetStringW( rec, 1, table, &sz );
number = MSI_RecordGetInteger( rec, 2 );
@@ -3358,7 +3342,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
}
if (!(err_cond & MSITRANSFORM_ERROR_VIEWTRANSFORM) &&
- !wcscmp( name, szColumns ))
+ !wcscmp( name, L"_Columns" ))
msi_update_table_columns( db, table );
msiobj_release( &rec->hdr );
@@ -3422,8 +3406,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
if ( name[0] != 0x4840 )
continue;
- if ( !wcscmp( name+1, szStringPool ) ||
- !wcscmp( name+1, szStringData ) )
+ if ( !wcscmp( name+1, L"_StringPool" ) ||
+ !wcscmp( name+1, L"_StringData" ) )
continue;
transform = msi_alloc_zero( sizeof(TRANSFORMDATA) );
@@ -3434,11 +3418,11 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
transform->name = strdupW( name + 1 );
- if ( !wcscmp( transform->name, szTables ) )
+ if ( !wcscmp( transform->name, L"_Tables" ) )
tables = transform;
- else if (!wcscmp( transform->name, szColumns ) )
+ else if (!wcscmp( transform->name, L"_Columns" ) )
columns = transform;
- else if (!wcscmp( transform->name, szProperty ))
+ else if (!wcscmp( transform->name, L"Property" ))
property_update = TRUE;
TRACE("transform contains stream %s\n", debugstr_w(name));
@@ -3462,6 +3446,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
L"`Table` CHAR(0) NOT NULL TEMPORARY, `Column` CHAR(0) NOT NULL TEMPORARY, "
L"`Row` CHAR(0) TEMPORARY, `Data` CHAR(0) TEMPORARY, `Current` CHAR(0) TEMPORARY "
L"PRIMARY KEY `Table`, `Column`, `Row` ) HOLD";
+
MSIQUERY *query;
UINT r;
@@ -3506,8 +3491,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg, int err_cond )
{
transform = LIST_ENTRY( list_head( &transforms ), TRANSFORMDATA, entry );
- if ( wcscmp( transform->name, szColumns ) &&
- wcscmp( transform->name, szTables ) &&
+ if ( wcscmp( transform->name, L"_Columns" ) &&
+ wcscmp( transform->name, L"_Tables" ) &&
ret == ERROR_SUCCESS )
{
ret = msi_table_load_transform( db, stg, strings, transform, bytes_per_strref, err_cond );
diff --git a/dlls/msi/upgrade.c b/dlls/msi/upgrade.c
index 60b5c74f40b..18649fced3d 100644
--- a/dlls/msi/upgrade.c
+++ b/dlls/msi/upgrade.c
@@ -97,13 +97,13 @@ static void append_productcode( MSIPACKAGE *package, const WCHAR *action_prop, c
if (prop)
{
lstrcpyW( newprop, prop );
- lstrcatW( newprop, szSemiColon );
+ lstrcatW( newprop, L";" );
}
else newprop[0] = 0;
lstrcatW( newprop, product );
r = msi_set_property( package->db, action_prop, newprop, -1 );
- if (r == ERROR_SUCCESS && !wcscmp( action_prop, szSourceDir ))
+ if (r == ERROR_SUCCESS && !wcscmp( action_prop, L"SourceDir" ))
msi_reset_source_folders( package );
TRACE( "related product property %s now %s\n", debugstr_w(action_prop), debugstr_w(newprop) );
@@ -210,35 +210,32 @@ static UINT ITERATE_FindRelatedProducts(MSIRECORD *rec, LPVOID param)
}
RegCloseKey(hkey);
msiobj_release( &uirow->hdr);
-
+
return ERROR_SUCCESS;
}
UINT ACTION_FindRelatedProducts(MSIPACKAGE *package)
{
- static const WCHAR query[] = {
- 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
- '`','U','p','g','r','a','d','e','`',0};
MSIQUERY *view;
UINT rc;
- if (msi_get_property_int(package->db, szInstalled, 0))
+ if (msi_get_property_int(package->db, L"Installed", 0))
{
TRACE("Skipping FindRelatedProducts action: product already installed\n");
return ERROR_SUCCESS;
}
- if (msi_action_is_unique(package, szFindRelatedProducts))
+ if (msi_action_is_unique(package, L"FindRelatedProducts"))
{
TRACE("Skipping FindRelatedProducts action: already done in UI sequence\n");
return ERROR_SUCCESS;
}
else
- msi_register_unique_action(package, szFindRelatedProducts);
+ msi_register_unique_action(package, L"FindRelatedProducts");
- rc = MSI_DatabaseOpenViewW(package->db, query, &view);
+ rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Upgrade`", &view);
if (rc != ERROR_SUCCESS)
return ERROR_SUCCESS;
-
+
rc = MSI_IterateRecords(view, NULL, ITERATE_FindRelatedProducts, package);
msiobj_release(&view->hdr);
return rc;
diff --git a/dlls/msi/where.c b/dlls/msi/where.c
index 07064f0f980..2a64de8cd9d 100644
--- a/dlls/msi/where.c
+++ b/dlls/msi/where.c
@@ -1235,7 +1235,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR tables,
wv = msi_alloc_zero( sizeof *wv );
if( !wv )
return ERROR_FUNCTION_FAILED;
-
+
/* fill the structure */
wv->view.ops = &where_ops;
msiobj_addref( &db->hdr );
--
2.28.0
1
0
[PATCH] wbemprox: Implement Win32_SoundDevice.{DeviceID, PNPDeviceID}.
by Pengpeng Dong Oct. 29, 2020
by Pengpeng Dong Oct. 29, 2020
Oct. 29, 2020
1
0
Signed-off-by: Austin English <austinenglish(a)gmail.com>
---
dlls/ddrawex/Makefile.in | 2 ++
dlls/ddrawex/version.rc | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 dlls/ddrawex/version.rc
diff --git a/dlls/ddrawex/Makefile.in b/dlls/ddrawex/Makefile.in
index fc4a50bbab7..056f90a222f 100644
--- a/dlls/ddrawex/Makefile.in
+++ b/dlls/ddrawex/Makefile.in
@@ -9,3 +9,5 @@ C_SRCS = \
surface.c
IDL_SRCS = ddrawex.idl
+
+RC_SRCS = version.rc
diff --git a/dlls/ddrawex/version.rc b/dlls/ddrawex/version.rc
new file mode 100644
index 00000000000..b58c91950ff
--- /dev/null
+++ b/dlls/ddrawex/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2020 Austin English
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine ddrawex"
+#define WINE_FILENAME_STR "ddrawex.dll"
+#define WINE_FILEVERSION 5,3,0,900
+#define WINE_FILEVERSION_STR "5.3.0.900"
+#define WINE_PRODUCTVERSION 5,3,0,900
+#define WINE_PRODUCTVERSION_STR "5.3.0.900"
+
+#include "wine/wine_common_ver.rc"
--
2.28.0
1
7
Signed-off-by: Austin English <austinenglish(a)gmail.com>
---
configure.ac | 1 +
dlls/d3dpmesh/Makefile.in | 8 +++++++
dlls/d3dpmesh/d3dpmesh.spec | 1 +
dlls/d3dpmesh/d3dpmesh_main.c | 42 +++++++++++++++++++++++++++++++++++
dlls/d3dpmesh/version.rc | 26 ++++++++++++++++++++++
5 files changed, 78 insertions(+)
create mode 100644 dlls/d3dpmesh/Makefile.in
create mode 100644 dlls/d3dpmesh/d3dpmesh.spec
create mode 100644 dlls/d3dpmesh/d3dpmesh_main.c
create mode 100644 dlls/d3dpmesh/version.rc
diff --git a/configure.ac b/configure.ac
index 2f81fd22610..719a338e5ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3157,6 +3157,7 @@ WINE_CONFIG_MAKEFILE(dlls/d3dcompiler_47)
WINE_CONFIG_MAKEFILE(dlls/d3dcompiler_47/tests)
WINE_CONFIG_MAKEFILE(dlls/d3dim)
WINE_CONFIG_MAKEFILE(dlls/d3dim700)
+WINE_CONFIG_MAKEFILE(dlls/d3dpmesh)
WINE_CONFIG_MAKEFILE(dlls/d3drm)
WINE_CONFIG_MAKEFILE(dlls/d3drm/tests)
WINE_CONFIG_MAKEFILE(dlls/d3dx10_33)
diff --git a/dlls/d3dpmesh/Makefile.in b/dlls/d3dpmesh/Makefile.in
new file mode 100644
index 00000000000..2a7546832c2
--- /dev/null
+++ b/dlls/d3dpmesh/Makefile.in
@@ -0,0 +1,8 @@
+MODULE = d3dpmesh.dll
+
+EXTRADLLFLAGS = -mno-cygwin
+
+C_SRCS = \
+ d3dpmesh_main.c
+
+RC_SRCS = version.rc
diff --git a/dlls/d3dpmesh/d3dpmesh.spec b/dlls/d3dpmesh/d3dpmesh.spec
new file mode 100644
index 00000000000..d4b9a46bd7a
--- /dev/null
+++ b/dlls/d3dpmesh/d3dpmesh.spec
@@ -0,0 +1 @@
+@ stub CreateD3DRMPMeshVisual
diff --git a/dlls/d3dpmesh/d3dpmesh_main.c b/dlls/d3dpmesh/d3dpmesh_main.c
new file mode 100644
index 00000000000..3d84a693a45
--- /dev/null
+++ b/dlls/d3dpmesh/d3dpmesh_main.c
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright 2020 Austin English
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dpmesh);
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+ TRACE("(%p, %u, %p)\n", instance, reason, reserved);
+
+ switch (reason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(instance);
+ break;
+ }
+
+ return TRUE;
+}
diff --git a/dlls/d3dpmesh/version.rc b/dlls/d3dpmesh/version.rc
new file mode 100644
index 00000000000..87e601a95a7
--- /dev/null
+++ b/dlls/d3dpmesh/version.rc
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2020 Austin English
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define WINE_FILEDESCRIPTION_STR "Wine d3dpmesh"
+#define WINE_FILENAME_STR "d3dpmesh.dll"
+#define WINE_FILEVERSION 5,0,2134,1
+#define WINE_FILEVERSION_STR "5.0.2134.1"
+#define WINE_PRODUCTVERSION 5,0,2134,1
+#define WINE_PRODUCTVERSION_STR "5.0.2134.1"
+
+#include "wine/wine_common_ver.rc"
--
2.28.0
1
4
Oct. 28, 2020
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com>
---
French Guiana never used DST
---
loader/wine.inf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index fba071fe0d8..72b10d354e0 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -3491,7 +3491,7 @@ HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"Dlt",,"SA Eastern D
HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"MUI_Dlt",,"@tzres.dll,-40657"
HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"MUI_Std",,"@tzres.dll,-40656"
HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"Std",,"SA Eastern Standard Time"
-HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,03,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,01,00,00,00,00,00,00,00,00,00
+HKLM,%CurrentVersionNT%\Time Zones\SA Eastern Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
HKLM,%CurrentVersionNT%\Time Zones\SA Pacific Standard Time,"Display",,"America/Bogota"
HKLM,%CurrentVersionNT%\Time Zones\SA Pacific Standard Time,"Dlt",,"SA Pacific Daylight Time"
HKLM,%CurrentVersionNT%\Time Zones\SA Pacific Standard Time,"MUI_Dlt",,"@tzres.dll,-49425"
--
2.17.1
1
0