Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1d124f88
Commit
1d124f88
authored
Oct 15, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Compile with -D__WINESRC__.
parent
0354af64
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
112 additions
and
59 deletions
+112
-59
Makefile.in
dlls/msi/tests/Makefile.in
+0
-1
action.c
dlls/msi/tests/action.c
+8
-2
automation.c
dlls/msi/tests/automation.c
+8
-2
db.c
dlls/msi/tests/db.c
+0
-0
format.c
dlls/msi/tests/format.c
+10
-2
install.c
dlls/msi/tests/install.c
+36
-23
msi.c
dlls/msi/tests/msi.c
+9
-3
package.c
dlls/msi/tests/package.c
+18
-12
patch.c
dlls/msi/tests/patch.c
+20
-11
record.c
dlls/msi/tests/record.c
+1
-1
suminfo.c
dlls/msi/tests/suminfo.c
+2
-2
No files found.
dlls/msi/tests/Makefile.in
View file @
1d124f88
TESTDLL
=
msi.dll
IMPORTS
=
cabinet msi shell32 ole32 oleaut32 user32 advapi32 version
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
action.c
\
...
...
dlls/msi/tests/action.c
View file @
1d124f88
...
...
@@ -2443,9 +2443,14 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
{
MSIHANDLE
db
;
UINT
r
;
int
j
;
WCHAR
*
nameW
;
int
j
,
len
;
r
=
MsiOpenDatabaseA
(
name
,
MSIDBOPEN_CREATE
,
&
db
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
if
(
!
(
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
nameW
,
len
);
r
=
MsiOpenDatabaseW
(
nameW
,
MSIDBOPEN_CREATE
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* import the tables into the database */
...
...
@@ -2467,6 +2472,7 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
db
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
}
static
BOOL
notify_system_change
(
DWORD
event_type
,
STATEMGRSTATUS
*
status
)
...
...
dlls/msi/tests/automation.c
View file @
1d124f88
...
...
@@ -275,9 +275,14 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
{
MSIHANDLE
db
;
UINT
r
;
int
j
;
WCHAR
*
nameW
;
int
j
,
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
if
(
!
(
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
nameW
,
len
);
r
=
MsiOpenDatabase
A
(
name
,
MSIDBOPEN_CREATE
,
&
db
);
r
=
MsiOpenDatabase
W
(
nameW
,
MSIDBOPEN_CREATE
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* import the tables into the database */
...
...
@@ -299,6 +304,7 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
db
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
}
static
BOOL
create_package
(
LPWSTR
path
)
...
...
dlls/msi/tests/db.c
View file @
1d124f88
This diff is collapsed.
Click to expand it.
dlls/msi/tests/format.c
View file @
1d124f88
...
...
@@ -203,7 +203,7 @@ static MSIHANDLE create_package_db(void)
DeleteFileW
(
msifileW
);
/* create an empty database */
res
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
res
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create database %u
\n
"
,
res
);
if
(
res
!=
ERROR_SUCCESS
)
return
0
;
...
...
@@ -267,11 +267,19 @@ static UINT helper_createpackage( const char *szName, MSIHANDLE *handle )
{
MSIHANDLE
hPackage
,
suminfo
,
hdb
=
0
;
UINT
res
;
WCHAR
*
nameW
;
int
len
;
DeleteFileA
(
szName
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
NULL
,
0
);
if
(
!
(
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
ERROR_OUTOFMEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szName
,
-
1
,
nameW
,
len
);
/* create an empty database */
res
=
MsiOpenDatabaseA
(
szName
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
res
=
MsiOpenDatabaseW
(
nameW
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create database %u
\n
"
,
res
);
if
(
res
!=
ERROR_SUCCESS
)
return
res
;
...
...
dlls/msi/tests/install.c
View file @
1d124f88
...
...
@@ -2306,9 +2306,14 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
{
MSIHANDLE
db
;
UINT
r
;
int
j
;
WCHAR
*
nameW
;
int
j
,
len
;
r
=
MsiOpenDatabaseA
(
name
,
MSIDBOPEN_CREATE
,
&
db
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
if
(
!
(
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
nameW
,
len
);
r
=
MsiOpenDatabaseW
(
nameW
,
MSIDBOPEN_CREATE
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* import the tables into the database */
...
...
@@ -2330,6 +2335,7 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
db
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
}
static
void
check_service_is_installed
(
void
)
...
...
@@ -2729,6 +2735,7 @@ static void test_packagecoltypes(void)
{
MSIHANDLE
hdb
,
view
,
rec
;
char
path
[
MAX_PATH
];
WCHAR
pathW
[
MAX_PATH
];
LPCSTR
query
;
UINT
r
,
count
;
...
...
@@ -2739,8 +2746,9 @@ static void test_packagecoltypes(void)
lstrcpyA
(
path
,
CURR_DIR
);
lstrcatA
(
path
,
"
\\
"
);
lstrcatA
(
path
,
msifile
);
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
pathW
,
MAX_PATH
);
r
=
MsiOpenDatabase
A
(
path
,
MSIDBOPEN_READONLY
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
pathW
,
MSIDBOPEN_READONLY
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
query
=
"SELECT * FROM `Media`"
;
...
...
@@ -3413,13 +3421,13 @@ static void generate_transform(void)
/* start with two identical databases */
CopyFileA
(
msifile
,
msifile2
,
FALSE
);
r
=
MsiOpenDatabase
A
(
msifile2
,
MSIDBOPEN_TRANSACT
,
&
hdb1
);
r
=
MsiOpenDatabase
W
(
msifile2W
,
MSIDBOPEN_TRANSACT
,
&
hdb1
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
r
=
MsiDatabaseCommit
(
hdb1
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to commit database
\n
"
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_READONLY
,
&
hdb2
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_READONLY
,
&
hdb2
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
query
=
"INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )"
;
...
...
@@ -3629,12 +3637,12 @@ error:
RemoveDirectoryA
(
"diffdir"
);
}
static
void
set_admin_summary_info
(
const
CHAR
*
name
)
static
void
set_admin_summary_info
(
const
W
CHAR
*
name
)
{
MSIHANDLE
db
,
summary
;
UINT
r
;
r
=
MsiOpenDatabase
A
(
name
,
MSIDBOPEN_DIRECT
,
&
db
);
r
=
MsiOpenDatabase
W
(
name
,
MSIDBOPEN_DIRECT
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiGetSummaryInformationA
(
db
,
NULL
,
1
,
&
summary
);
...
...
@@ -3663,7 +3671,7 @@ static void test_admin(void)
create_file
(
"msitest
\\
augustus"
,
500
);
create_database
(
msifile
,
adm_tables
,
sizeof
(
adm_tables
)
/
sizeof
(
msi_table
));
set_admin_summary_info
(
msifile
);
set_admin_summary_info
(
msifile
W
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
...
...
@@ -3740,7 +3748,7 @@ static void test_adminprops(void)
create_file
(
"msitest
\\
augustus"
,
500
);
create_database
(
msifile
,
amp_tables
,
sizeof
(
amp_tables
)
/
sizeof
(
msi_table
));
set_admin_summary_info
(
msifile
);
set_admin_summary_info
(
msifile
W
);
set_admin_property_stream
(
msifile
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
...
...
@@ -4615,6 +4623,9 @@ 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
\n
i0
\n
int0
\t
int0
\n
1"
;
static
const
char
int1
[]
=
"int1
\n
i1
\n
int1
\t
int1
\n
1"
;
static
const
char
int2
[]
=
"int2
\n
i2
\n
int2
\t
int2
\n
1"
;
...
...
@@ -4638,41 +4649,43 @@ static void test_int_widths( void )
{
int5
,
sizeof
(
int5
)
-
1
,
ERROR_FUNCTION_FAILED
},
{
int8
,
sizeof
(
int8
)
-
1
,
ERROR_FUNCTION_FAILED
}
};
char
tmpdir
[
MAX_PATH
],
msitable
[
MAX_PATH
],
msidb
[
MAX_PATH
];
WCHAR
tmpdir
[
MAX_PATH
],
msitable
[
MAX_PATH
],
msidb
[
MAX_PATH
];
MSIHANDLE
db
;
UINT
r
,
i
;
GetTempPath
A
(
MAX_PATH
,
tmpdir
);
CreateDirectory
A
(
tmpdir
,
NULL
);
GetTempPath
W
(
MAX_PATH
,
tmpdir
);
CreateDirectory
W
(
tmpdir
,
NULL
);
lstrcpyA
(
msitable
,
tmpdir
);
lstrcatA
(
msitable
,
"
\\
msitable.idt"
);
lstrcpyW
(
msitable
,
tmpdir
);
lstrcatW
(
msitable
,
slashW
);
lstrcatW
(
msitable
,
msitableW
);
lstrcpyA
(
msidb
,
tmpdir
);
lstrcatA
(
msidb
,
"
\\
msitest.msi"
);
lstrcpyW
(
msidb
,
tmpdir
);
lstrcatW
(
msidb
,
slashW
);
lstrcatW
(
msidb
,
msitestW
);
r
=
MsiOpenDatabase
A
(
msidb
,
MSIDBOPEN_CREATE
,
&
db
);
r
=
MsiOpenDatabase
W
(
msidb
,
MSIDBOPEN_CREATE
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
DWORD
count
;
HANDLE
handle
=
CreateFile
A
(
msitable
,
GENERIC_WRITE
,
0
,
NULL
,
HANDLE
handle
=
CreateFile
W
(
msitable
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
WriteFile
(
handle
,
tests
[
i
].
data
,
tests
[
i
].
size
,
&
count
,
NULL
);
CloseHandle
(
handle
);
r
=
MsiDatabaseImport
A
(
db
,
tmpdir
,
"msitable.idt"
);
r
=
MsiDatabaseImport
W
(
db
,
tmpdir
,
msitableW
);
ok
(
r
==
tests
[
i
].
ret
,
" %u expected %u, got %u
\n
"
,
i
,
tests
[
i
].
ret
,
r
);
r
=
MsiDatabaseCommit
(
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
DeleteFile
A
(
msitable
);
DeleteFile
W
(
msitable
);
}
MsiCloseHandle
(
db
);
DeleteFile
A
(
msidb
);
RemoveDirectory
A
(
tmpdir
);
DeleteFile
W
(
msidb
);
RemoveDirectory
W
(
tmpdir
);
}
static
void
test_shortcut
(
void
)
...
...
@@ -5254,7 +5267,7 @@ static void test_icon_table(void)
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
res
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_TRANSACT
,
&
hdb
);
res
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_TRANSACT
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"failed to open db: %d
\n
"
,
res
);
query
=
"CREATE TABLE `Icon` (`Name` CHAR(72) NOT NULL, `Data` OBJECT NOT NULL PRIMARY KEY `Name`)"
;
...
...
dlls/msi/tests/msi.c
View file @
1d124f88
...
...
@@ -1045,9 +1045,14 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
{
MSIHANDLE
db
;
UINT
r
;
int
j
;
WCHAR
*
nameW
;
int
j
,
len
;
r
=
MsiOpenDatabaseA
(
name
,
MSIDBOPEN_CREATE
,
&
db
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
if
(
!
(
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
nameW
,
len
);
r
=
MsiOpenDatabaseW
(
nameW
,
MSIDBOPEN_CREATE
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* import the tables into the database */
...
...
@@ -1069,6 +1074,7 @@ static void create_database_wordcount(const CHAR *name, const msi_table *tables,
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
db
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
}
static
UINT
run_query
(
MSIHANDLE
hdb
,
const
char
*
query
)
...
...
@@ -1140,7 +1146,7 @@ static MSIHANDLE create_package_db(LPSTR prodcode)
DeleteFileA
(
msifile
);
/* create an empty database */
res
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
res
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
if
(
res
!=
ERROR_SUCCESS
)
return
hdb
;
...
...
dlls/msi/tests/package.c
View file @
1d124f88
...
...
@@ -759,7 +759,7 @@ static MSIHANDLE create_package_db(void)
DeleteFileA
(
msifile
);
/* create an empty database */
res
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
res
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create database %u
\n
"
,
res
);
if
(
res
!=
ERROR_SUCCESS
)
return
hdb
;
...
...
@@ -2435,7 +2435,7 @@ static void test_msipackage(void)
r
=
MsiOpenPackageA
(
name
,
&
hpack
);
ok
(
r
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %d
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* database exists, but is emtpy */
...
...
@@ -2466,7 +2466,7 @@ static void test_msipackage(void)
DeleteFileA
(
msifile
);
/* start with a clean database to show what constitutes a valid package */
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
sprintf
(
name
,
"#%d"
,
hdb
);
...
...
@@ -2650,6 +2650,12 @@ static void test_states(void)
static
char
msifile2
[]
=
"winetest2-package.msi"
;
static
char
msifile3
[]
=
"winetest3-package.msi"
;
static
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
};
MSIHANDLE
hpkg
;
UINT
r
;
MSIHANDLE
hdb
;
...
...
@@ -3098,7 +3104,7 @@ static void test_states(void)
r
=
MsiInstallProductA
(
msifile
,
"ADDLOCAL=one,four ADDSOURCE=two,three REMOVE=six,seven REINSTALL=eight,nine,ten"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database: %d
\n
"
,
r
);
/* these properties must not be in the saved msi file */
...
...
@@ -3182,7 +3188,7 @@ static void test_states(void)
r
=
MsiInstallProductA
(
msifile2
,
"ADDLOCAL=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
msifile2
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifile2W
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database: %d
\n
"
,
r
);
/* these properties must not be in the saved msi file */
...
...
@@ -3249,7 +3255,7 @@ static void test_states(void)
r
=
MsiInstallProductA
(
msifile3
,
"ADDSOURCE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
msifile3
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifile3W
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database: %d
\n
"
,
r
);
/* this property must not be in the saved msi file */
...
...
@@ -3318,7 +3324,7 @@ static void test_states(void)
r
=
MsiInstallProductA
(
msifile3
,
"REINSTALL=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
msifile4
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifile4W
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database: %d
\n
"
,
r
);
/* this property must not be in the saved msi file */
...
...
@@ -6826,7 +6832,7 @@ static void test_MsiGetSourcePath(void)
/* compressed source */
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
set_suminfo_prop
(
hdb
,
PID_WORDCOUNT
,
msidbSumInfoSourceTypeCompressed
);
...
...
@@ -7340,7 +7346,7 @@ static void test_shortlongsource(void)
/* short file names */
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
set_suminfo_prop
(
hdb
,
PID_WORDCOUNT
,
msidbSumInfoSourceTypeSFN
);
...
...
@@ -7960,7 +7966,7 @@ static void test_access(void)
MSIHANDLE
hdb
;
UINT
r
;
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
test_file_access
(
msifile
,
create
);
...
...
@@ -7974,7 +7980,7 @@ static void test_access(void)
test_file_access
(
msifile
,
create_close
);
DeleteFileA
(
msifile
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATEDIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
test_file_access
(
msifile
,
create
);
...
...
@@ -8177,7 +8183,7 @@ static void test_MsiGetProductProperty(void)
if
(
is_wow64
)
access
|=
KEY_WOW64_64KEY
;
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiDatabaseCommit
(
hdb
);
...
...
dlls/msi/tests/patch.c
View file @
1d124f88
...
...
@@ -266,12 +266,12 @@ static void write_file( const char *filename, const char *data, DWORD data_size
CloseHandle
(
file
);
}
static
void
set_suminfo
(
const
char
*
filename
)
static
void
set_suminfo
(
const
WCHAR
*
filename
)
{
UINT
r
;
MSIHANDLE
hsi
,
hdb
;
r
=
MsiOpenDatabase
A
(
filename
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
filename
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database %u
\n
"
,
r
);
r
=
MsiGetSummaryInformationA
(
hdb
,
NULL
,
7
,
&
hsi
);
...
...
@@ -312,8 +312,14 @@ static void create_database( const char *filename, const struct msi_table *table
{
MSIHANDLE
hdb
;
UINT
r
,
i
;
WCHAR
*
filenameW
;
int
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
NULL
,
0
);
if
(
!
(
filenameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
return
;
MultiByteToWideChar
(
CP_ACP
,
0
,
filename
,
-
1
,
filenameW
,
len
);
r
=
MsiOpenDatabase
A
(
filename
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
filenameW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* import the tables into the database */
...
...
@@ -333,7 +339,8 @@ static void create_database( const char *filename, const struct msi_table *table
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
set_suminfo
(
filename
);
set_suminfo
(
filenameW
);
HeapFree
(
GetProcessHeap
(),
0
,
filenameW
);
}
/* data for generating a patch */
...
...
@@ -712,6 +719,7 @@ static void test_simple_patch( void )
DWORD
size
;
char
path
[
MAX_PATH
],
install_source
[
MAX_PATH
],
buffer
[
32
];
const
char
*
query
;
WCHAR
pathW
[
MAX_PATH
];
MSIHANDLE
hpackage
,
hdb
,
hview
,
hrec
;
if
(
!
pMsiApplyPatchA
)
...
...
@@ -860,7 +868,8 @@ static void test_simple_patch( void )
"LocalPackage"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiOpenDatabaseA
(
path
,
MSIDBOPEN_READONLY
,
&
hdb
);
MultiByteToWideChar
(
CP_ACP
,
0
,
path
,
-
1
,
pathW
,
MAX_PATH
);
r
=
MsiOpenDatabaseW
(
pathW
,
MSIDBOPEN_READONLY
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
...
...
@@ -902,25 +911,25 @@ static void test_MsiOpenDatabase( void )
UINT
r
;
MSIHANDLE
hdb
;
r
=
MsiOpenDatabase
A
(
mspfile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
mspfileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database %u
\n
"
,
r
);
r
=
MsiDatabaseCommit
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to commit database %u
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
r
=
MsiOpenDatabase
A
(
mspfile
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
mspfileW
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
ok
(
r
==
ERROR_OPEN_FAILED
,
"expected ERROR_OPEN_FAILED, got %u
\n
"
,
r
);
DeleteFileA
(
mspfile
);
r
=
MsiOpenDatabase
A
(
mspfile
,
MSIDBOPEN_CREATE
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
mspfileW
,
MSIDBOPEN_CREATE
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database %u
\n
"
,
r
);
r
=
MsiDatabaseCommit
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to commit database %u
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
r
=
MsiOpenDatabase
A
(
mspfile
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
mspfileW
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database %u
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
DeleteFileA
(
mspfile
);
...
...
@@ -928,10 +937,10 @@ static void test_MsiOpenDatabase( void )
create_database
(
msifile
,
tables
,
sizeof
(
tables
)
/
sizeof
(
struct
msi_table
)
);
create_patch
(
mspfile
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
ok
(
r
==
ERROR_OPEN_FAILED
,
"failed to open database %u
\n
"
,
r
);
r
=
MsiOpenDatabase
A
(
mspfile
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
mspfileW
,
MSIDBOPEN_READONLY
+
MSIDBOPEN_PATCHFILE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open database %u
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
...
...
dlls/msi/tests/record.c
View file @
1d124f88
...
...
@@ -547,7 +547,7 @@ static void test_fieldzero(void)
MsiCloseHandle
(
rec
);
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
query
=
"CREATE TABLE `drone` ( "
...
...
dlls/msi/tests/suminfo.c
View file @
1d124f88
...
...
@@ -79,7 +79,7 @@ static void test_suminfo(void)
DeleteFileA
(
msifile
);
/* just MsiOpenDatabase should not create a file */
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
r
=
MsiGetSummaryInformationA
(
hdb
,
NULL
,
0
,
NULL
);
...
...
@@ -411,7 +411,7 @@ static void test_summary_binary(void)
ok
(
GetFileAttributesA
(
msifile
)
!=
INVALID_FILE_ATTRIBUTES
,
"file doesn't exist!
\n
"
);
/* just MsiOpenDatabase should not create a file */
r
=
MsiOpenDatabase
A
(
msifile
,
MSIDBOPEN_READONLY
,
&
hdb
);
r
=
MsiOpenDatabase
W
(
msifileW
,
MSIDBOPEN_READONLY
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
r
=
MsiGetSummaryInformationA
(
hdb
,
NULL
,
0
,
&
hsuminfo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment