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
5f1b258c
Commit
5f1b258c
authored
Sep 14, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert the list of tables to a standard list.
parent
b5f87893
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
27 deletions
+12
-27
database.c
dlls/msi/database.c
+3
-3
msipriv.h
dlls/msi/msipriv.h
+1
-1
table.c
dlls/msi/table.c
+8
-23
No files found.
dlls/msi/database.c
View file @
5f1b258c
...
@@ -134,15 +134,14 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
...
@@ -134,15 +134,14 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
goto
end
;
goto
end
;
}
}
if
((
memcmp
(
&
stat
.
clsid
,
&
CLSID_MsiDatabase
,
sizeof
(
GUID
)
)
)
if
(
!
IsEqualGUID
(
&
stat
.
clsid
,
&
CLSID_MsiDatabase
)
&&
&&
(
memcmp
(
&
stat
.
clsid
,
&
CLSID_MsiPatch
,
sizeof
(
GUID
)
)
))
!
IsEqualGUID
(
&
stat
.
clsid
,
&
CLSID_MsiPatch
)
)
{
{
ERR
(
"storage GUID is not a MSI database GUID %s
\n
"
,
ERR
(
"storage GUID is not a MSI database GUID %s
\n
"
,
debugstr_guid
(
&
stat
.
clsid
)
);
debugstr_guid
(
&
stat
.
clsid
)
);
goto
end
;
goto
end
;
}
}
db
=
alloc_msiobject
(
MSIHANDLETYPE_DATABASE
,
sizeof
(
MSIDATABASE
),
db
=
alloc_msiobject
(
MSIHANDLETYPE_DATABASE
,
sizeof
(
MSIDATABASE
),
MSI_CloseDatabase
);
MSI_CloseDatabase
);
if
(
!
db
)
if
(
!
db
)
...
@@ -156,6 +155,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
...
@@ -156,6 +155,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
db
->
storage
=
stg
;
db
->
storage
=
stg
;
db
->
mode
=
szMode
;
db
->
mode
=
szMode
;
list_init
(
&
db
->
tables
);
ret
=
load_string_table
(
db
);
ret
=
load_string_table
(
db
);
if
(
ret
!=
ERROR_SUCCESS
)
if
(
ret
!=
ERROR_SUCCESS
)
...
...
dlls/msi/msipriv.h
View file @
5f1b258c
...
@@ -67,7 +67,7 @@ typedef struct tagMSIDATABASE
...
@@ -67,7 +67,7 @@ typedef struct tagMSIDATABASE
IStorage
*
storage
;
IStorage
*
storage
;
string_table
*
strings
;
string_table
*
strings
;
LPCWSTR
mode
;
LPCWSTR
mode
;
MSITABLE
*
first_table
,
*
last_table
;
struct
list
tables
;
}
MSIDATABASE
;
}
MSIDATABASE
;
typedef
struct
tagMSIVIEW
MSIVIEW
;
typedef
struct
tagMSIVIEW
MSIVIEW
;
...
...
dlls/msi/table.c
View file @
5f1b258c
...
@@ -53,8 +53,7 @@ struct tagMSITABLE
...
@@ -53,8 +53,7 @@ struct tagMSITABLE
USHORT
**
data
;
USHORT
**
data
;
UINT
ref_count
;
UINT
ref_count
;
UINT
row_count
;
UINT
row_count
;
struct
tagMSITABLE
*
next
;
struct
list
entry
;
struct
tagMSITABLE
*
prev
;
WCHAR
name
[
1
];
WCHAR
name
[
1
];
};
};
...
@@ -483,28 +482,13 @@ static UINT read_table_from_storage( MSIDATABASE *db, LPCWSTR name, MSITABLE **p
...
@@ -483,28 +482,13 @@ static UINT read_table_from_storage( MSIDATABASE *db, LPCWSTR name, MSITABLE **p
/* add this table to the list of cached tables in the database */
/* add this table to the list of cached tables in the database */
void
add_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
void
add_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
{
{
table
->
next
=
db
->
first_table
;
list_add_head
(
&
db
->
tables
,
&
table
->
entry
);
table
->
prev
=
NULL
;
if
(
db
->
first_table
)
db
->
first_table
->
prev
=
table
;
else
db
->
last_table
=
table
;
db
->
first_table
=
table
;
}
}
/* remove from the list of cached tables */
/* remove from the list of cached tables */
void
remove_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
void
remove_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
{
{
if
(
table
->
next
)
list_remove
(
&
table
->
entry
);
table
->
next
->
prev
=
table
->
prev
;
else
db
->
last_table
=
table
->
prev
;
if
(
table
->
prev
)
table
->
prev
->
next
=
table
->
next
;
else
db
->
first_table
=
table
->
next
;
table
->
next
=
NULL
;
table
->
prev
=
NULL
;
}
}
static
void
release_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
static
void
release_table
(
MSIDATABASE
*
db
,
MSITABLE
*
table
)
...
@@ -523,10 +507,11 @@ static void release_table( MSIDATABASE *db, MSITABLE *table )
...
@@ -523,10 +507,11 @@ static void release_table( MSIDATABASE *db, MSITABLE *table )
void
free_cached_tables
(
MSIDATABASE
*
db
)
void
free_cached_tables
(
MSIDATABASE
*
db
)
{
{
while
(
db
->
first_table
)
while
(
!
list_empty
(
&
db
->
tables
)
)
{
{
MSITABLE
*
t
=
db
->
first_table
;
MSITABLE
*
t
=
LIST_ENTRY
(
list_head
(
&
db
->
tables
),
MSITABLE
,
entry
)
;
list_remove
(
&
t
->
entry
);
if
(
--
t
->
ref_count
)
if
(
--
t
->
ref_count
)
ERR
(
"table ref count not zero for %s
\n
"
,
debugstr_w
(
t
->
name
));
ERR
(
"table ref count not zero for %s
\n
"
,
debugstr_w
(
t
->
name
));
remove_table
(
db
,
t
);
remove_table
(
db
,
t
);
...
@@ -539,7 +524,7 @@ UINT find_cached_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **ptable)
...
@@ -539,7 +524,7 @@ UINT find_cached_table(MSIDATABASE *db, LPCWSTR name, MSITABLE **ptable)
{
{
MSITABLE
*
t
;
MSITABLE
*
t
;
for
(
t
=
db
->
first_table
;
t
;
t
=
t
->
next
)
LIST_FOR_EACH_ENTRY
(
t
,
&
db
->
tables
,
MSITABLE
,
entry
)
{
{
if
(
!
lstrcmpW
(
name
,
t
->
name
)
)
if
(
!
lstrcmpW
(
name
,
t
->
name
)
)
{
{
...
@@ -1580,7 +1565,7 @@ UINT MSI_CommitTables( MSIDATABASE *db )
...
@@ -1580,7 +1565,7 @@ UINT MSI_CommitTables( MSIDATABASE *db )
return
r
;
return
r
;
}
}
for
(
table
=
db
->
first_table
;
table
;
table
=
table
->
next
)
LIST_FOR_EACH_ENTRY
(
table
,
&
db
->
tables
,
MSITABLE
,
entry
)
{
{
r
=
save_table
(
db
,
table
);
r
=
save_table
(
db
,
table
);
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
...
...
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