Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ccd030c7
Commit
ccd030c7
authored
Jul 07, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 08, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add handling for the special _Storages table.
parent
ae9b5791
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
59 deletions
+31
-59
Makefile.in
dlls/msi/Makefile.in
+1
-0
msiquery.c
dlls/msi/msiquery.c
+1
-1
query.h
dlls/msi/query.h
+2
-0
storages.c
dlls/msi/storages.c
+0
-0
table.c
dlls/msi/table.c
+3
-0
db.c
dlls/msi/tests/db.c
+24
-58
No files found.
dlls/msi/Makefile.in
View file @
ccd030c7
...
...
@@ -39,6 +39,7 @@ C_SRCS = \
script.c
\
select
.c
\
source.c
\
storages.c
\
streams.c
\
string.c
\
suminfo.c
\
...
...
dlls/msi/msiquery.c
View file @
ccd030c7
...
...
@@ -326,7 +326,7 @@ UINT msi_view_get_row(MSIDATABASE *db, MSIVIEW *view, UINT row, MSIRECORD **rec)
IStream_Release
(
stm
);
}
else
ERR
(
"failed to get stream
\n
"
);
WARN
(
"failed to get stream
\n
"
);
continue
;
}
...
...
dlls/msi/query.h
View file @
ccd030c7
...
...
@@ -115,6 +115,8 @@ UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, column_inf
UINT
STREAMS_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
);
UINT
STORAGES_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
);
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
);
MSIRECORD
*
msi_query_merge_record
(
UINT
fields
,
const
column_info
*
vl
,
MSIRECORD
*
rec
);
...
...
dlls/msi/storages.c
0 → 100644
View file @
ccd030c7
This diff is collapsed.
Click to expand it.
dlls/msi/table.c
View file @
ccd030c7
...
...
@@ -2109,11 +2109,14 @@ UINT TABLE_CreateView( MSIDATABASE *db, LPCWSTR name, MSIVIEW **view )
UINT
r
,
sz
;
static
const
WCHAR
Streams
[]
=
{
'_'
,
'S'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
's'
,
0
};
static
const
WCHAR
Storages
[]
=
{
'_'
,
'S'
,
't'
,
'o'
,
'r'
,
'a'
,
'g'
,
'e'
,
's'
,
0
};
TRACE
(
"%p %s %p
\n
"
,
db
,
debugstr_w
(
name
),
view
);
if
(
!
lstrcmpW
(
name
,
Streams
)
)
return
STREAMS_CreateView
(
db
,
view
);
else
if
(
!
lstrcmpW
(
name
,
Storages
)
)
return
STORAGES_CreateView
(
db
,
view
);
sz
=
sizeof
*
tv
+
lstrlenW
(
name
)
*
sizeof
name
[
0
]
;
tv
=
msi_alloc_zero
(
sz
);
...
...
dlls/msi/tests/db.c
View file @
ccd030c7
...
...
@@ -6054,22 +6054,16 @@ static void test_storages_table(void)
/* check the column types */
hrec
=
get_column_info
(
hdb
,
"SELECT * FROM `_Storages`"
,
MSICOLINFO_TYPES
);
ok
(
hrec
,
"failed to get column info hrecord
\n
"
);
todo_wine
{
ok
(
check_record
(
hrec
,
1
,
"s62"
),
"wrong hrecord type
\n
"
);
ok
(
check_record
(
hrec
,
2
,
"V0"
),
"wrong hrecord type
\n
"
);
}
ok
(
check_record
(
hrec
,
1
,
"s62"
),
"wrong hrecord type
\n
"
);
ok
(
check_record
(
hrec
,
2
,
"V0"
),
"wrong hrecord type
\n
"
);
MsiCloseHandle
(
hrec
);
/* now try the names */
hrec
=
get_column_info
(
hdb
,
"SELECT * FROM `_Storages`"
,
MSICOLINFO_NAMES
);
ok
(
hrec
,
"failed to get column info hrecord
\n
"
);
todo_wine
{
ok
(
check_record
(
hrec
,
1
,
"Name"
),
"wrong hrecord type
\n
"
);
ok
(
check_record
(
hrec
,
2
,
"Data"
),
"wrong hrecord type
\n
"
);
}
ok
(
check_record
(
hrec
,
1
,
"Name"
),
"wrong hrecord type
\n
"
);
ok
(
check_record
(
hrec
,
2
,
"Data"
),
"wrong hrecord type
\n
"
);
MsiCloseHandle
(
hrec
);
...
...
@@ -6085,16 +6079,10 @@ static void test_storages_table(void)
query
=
"INSERT INTO `_Storages` (`Name`, `Data`) VALUES (?, ?)"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database hview: %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database hview: %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
hrec
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute hview: %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute hview: %d
\n
"
,
r
);
MsiCloseHandle
(
hrec
);
MsiViewClose
(
hview
);
...
...
@@ -6102,30 +6090,18 @@ static void test_storages_table(void)
query
=
"SELECT `Name`, `Data` FROM `_Storages`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database hview: %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database hview: %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute hview: %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute hview: %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to fetch hrecord: %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to fetch hrecord: %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
hrec
,
1
,
file
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to get string: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
file
,
"stgname"
),
"Expected
\"
stgname
\"
, got
\"
%s
\"\n
"
,
file
);
}
ok
(
r
==
ERROR_SUCCESS
,
"Failed to get string: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
file
,
"stgname"
),
"Expected
\"
stgname
\"
, got
\"
%s
\"\n
"
,
file
);
size
=
MAX_PATH
;
lstrcpyA
(
buf
,
"apple"
);
...
...
@@ -6140,10 +6116,7 @@ static void test_storages_table(void)
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
todo_wine
{
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
}
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
...
...
@@ -6160,28 +6133,21 @@ static void test_storages_table(void)
MultiByteToWideChar
(
CP_ACP
,
0
,
"stgname"
,
-
1
,
name
,
MAX_PATH
);
hr
=
IStorage_OpenStorage
(
stg
,
name
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
NULL
,
0
,
&
inner
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
inner
!=
NULL
,
"Expected non-NULL storage
\n
"
);
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
inner
!=
NULL
,
"Expected non-NULL storage
\n
"
);
/* FIXME: remove when wine is fixed */
if
(
inner
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
"storage.bin"
,
-
1
,
name
,
MAX_PATH
);
hr
=
IStorage_OpenStream
(
inner
,
name
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
stm
!=
NULL
,
"Expected non-NULL stream
\n
"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"storage.bin"
,
-
1
,
name
,
MAX_PATH
);
hr
=
IStorage_OpenStream
(
inner
,
name
,
NULL
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
0
,
&
stm
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
stm
!=
NULL
,
"Expected non-NULL stream
\n
"
);
hr
=
IStream_Read
(
stm
,
buf
,
MAX_PATH
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
buf
,
"stgdata"
),
"Expected
\"
stgdata
\"
, got
\"
%s
\"\n
"
,
buf
);
hr
=
IStream_Read
(
stm
,
buf
,
MAX_PATH
,
&
size
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
ok
(
!
lstrcmpA
(
buf
,
"stgdata"
),
"Expected
\"
stgdata
\"
, got
\"
%s
\"\n
"
,
buf
);
IStream_Release
(
stm
);
IStorage_Release
(
inner
);
}
IStream_Release
(
stm
);
IStorage_Release
(
inner
);
IStorage_Release
(
stg
);
DeleteFileA
(
msifile
);
...
...
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