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
4d2e148f
Commit
4d2e148f
authored
Oct 25, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Oct 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use package_from_db instead of opening the package with MsiOpenPackage.
parent
1d9c680e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
db.c
dlls/msi/tests/db.c
+23
-7
No files found.
dlls/msi/tests/db.c
View file @
4d2e148f
...
@@ -2249,6 +2249,24 @@ static MSIHANDLE create_package_db(LPCSTR filename)
...
@@ -2249,6 +2249,24 @@ static MSIHANDLE create_package_db(LPCSTR filename)
return
hdb
;
return
hdb
;
}
}
static
MSIHANDLE
package_from_db
(
MSIHANDLE
hdb
)
{
UINT
res
;
CHAR
szPackage
[
10
];
MSIHANDLE
hPackage
;
sprintf
(
szPackage
,
"#%li"
,
hdb
);
res
=
MsiOpenPackage
(
szPackage
,
&
hPackage
);
if
(
res
!=
ERROR_SUCCESS
)
return
0
;
res
=
MsiCloseHandle
(
hdb
);
if
(
res
!=
ERROR_SUCCESS
)
return
0
;
return
hPackage
;
}
static
void
test_try_transform
(
void
)
static
void
test_try_transform
(
void
)
{
{
MSIHANDLE
hdb
,
hview
,
hrec
,
hpkg
;
MSIHANDLE
hdb
,
hview
,
hrec
,
hpkg
;
...
@@ -2258,11 +2276,10 @@ static void test_try_transform(void)
...
@@ -2258,11 +2276,10 @@ static void test_try_transform(void)
char
buffer
[
MAX_PATH
];
char
buffer
[
MAX_PATH
];
DeleteFile
(
msifile
);
DeleteFile
(
msifile
);
DeleteFile
(
msifile2
);
DeleteFile
(
mstfile
);
DeleteFile
(
mstfile
);
/* create the database */
/* create the database */
hdb
=
create_package_db
(
msifile
2
);
hdb
=
create_package_db
(
msifile
);
ok
(
hdb
,
"Failed to create package db
\n
"
);
ok
(
hdb
,
"Failed to create package db
\n
"
);
query
=
"CREATE TABLE `MOO` ( `NOO` SHORT NOT NULL, `OOO` CHAR(255) PRIMARY KEY `NOO`)"
;
query
=
"CREATE TABLE `MOO` ( `NOO` SHORT NOT NULL, `OOO` CHAR(255) PRIMARY KEY `NOO`)"
;
...
@@ -2315,7 +2332,7 @@ static void test_try_transform(void)
...
@@ -2315,7 +2332,7 @@ static void test_try_transform(void)
else
else
generate_transform_manual
();
generate_transform_manual
();
r
=
MsiOpenDatabase
(
msifile
2
,
MSIDBOPEN_DIRECT
,
&
hdb
);
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
r
=
MsiDatabaseApplyTransform
(
hdb
,
mstfile
,
0
);
r
=
MsiDatabaseApplyTransform
(
hdb
,
mstfile
,
0
);
...
@@ -2423,11 +2440,10 @@ static void test_try_transform(void)
...
@@ -2423,11 +2440,10 @@ static void test_try_transform(void)
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hdb
);
/* check that the property was added */
/* check that the property was added */
r
=
MsiOpenPackage
(
msifile2
,
&
hpkg
);
hpkg
=
package_from_db
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
hpkg
!=
0
,
"Expected non-NULL hpkg
\n
"
);
sz
=
MAX_PATH
;
sz
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"prop"
,
buffer
,
&
sz
);
r
=
MsiGetProperty
(
hpkg
,
"prop"
,
buffer
,
&
sz
);
...
@@ -2435,9 +2451,9 @@ static void test_try_transform(void)
...
@@ -2435,9 +2451,9 @@ static void test_try_transform(void)
ok
(
!
lstrcmp
(
buffer
,
"val"
),
"Expected val, got %s
\n
"
,
buffer
);
ok
(
!
lstrcmp
(
buffer
,
"val"
),
"Expected val, got %s
\n
"
,
buffer
);
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
DeleteFile
(
msifile
);
DeleteFile
(
msifile2
);
DeleteFile
(
mstfile
);
DeleteFile
(
mstfile
);
}
}
...
...
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