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
6b5f290d
Commit
6b5f290d
authored
Sep 16, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make load_string_table return the string table.
parent
43fece97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
19 deletions
+14
-19
database.c
dlls/msi/database.c
+4
-2
msipriv.h
dlls/msi/msipriv.h
+1
-1
table.c
dlls/msi/table.c
+9
-16
No files found.
dlls/msi/database.c
View file @
6b5f290d
...
...
@@ -157,10 +157,12 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath, LPCWSTR szPersist, MSIDATABASE **pdb)
db
->
mode
=
szMode
;
list_init
(
&
db
->
tables
);
ret
=
load_string_table
(
db
);
if
(
ret
!=
ERROR_SUCCESS
)
db
->
strings
=
load_string_table
(
stg
);
if
(
!
db
->
strings
)
goto
end
;
ret
=
ERROR_SUCCESS
;
msiobj_addref
(
&
db
->
hdr
);
IStorage_AddRef
(
stg
);
*
pdb
=
db
;
...
...
dlls/msi/msipriv.h
View file @
6b5f290d
...
...
@@ -276,7 +276,7 @@ extern void free_table( MSIDATABASE *db, MSITABLE *table );
extern
void
free_cached_tables
(
MSIDATABASE
*
db
);
extern
UINT
find_cached_table
(
MSIDATABASE
*
db
,
LPCWSTR
name
,
MSITABLE
**
table
);
extern
UINT
get_table
(
MSIDATABASE
*
db
,
LPCWSTR
name
,
MSITABLE
**
table
);
extern
UINT
load_string_table
(
MSIDATABASE
*
db
);
extern
string_table
*
load_string_table
(
IStorage
*
stg
);
extern
UINT
MSI_CommitTables
(
MSIDATABASE
*
db
);
extern
HRESULT
init_string_table
(
IStorage
*
stg
);
...
...
dlls/msi/table.c
View file @
6b5f290d
...
...
@@ -684,27 +684,22 @@ HRESULT init_string_table( IStorage *stg )
return
r
;
}
UINT
load_string_table
(
MSIDATABASE
*
db
)
string_table
*
load_string_table
(
IStorage
*
stg
)
{
string_table
*
st
=
NULL
;
CHAR
*
data
;
USHORT
*
pool
;
UINT
r
,
ret
=
ERROR_FUNCTION_FAILED
,
datasize
=
0
,
poolsize
=
0
,
codepage
;
UINT
r
,
datasize
=
0
,
poolsize
=
0
,
codepage
;
DWORD
i
,
count
,
offset
,
len
,
n
;
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
};
if
(
db
->
strings
)
{
msi_destroy_stringtable
(
db
->
strings
);
db
->
strings
=
NULL
;
}
r
=
read_stream_data
(
db
->
storage
,
szStringPool
,
&
pool
,
&
poolsize
);
r
=
read_stream_data
(
stg
,
szStringPool
,
&
pool
,
&
poolsize
);
if
(
r
!=
ERROR_SUCCESS
)
goto
end
;
r
=
read_stream_data
(
db
->
storage
,
szStringData
,
(
USHORT
**
)
&
data
,
&
datasize
);
r
=
read_stream_data
(
stg
,
szStringData
,
(
USHORT
**
)
&
data
,
&
datasize
);
if
(
r
!=
ERROR_SUCCESS
)
goto
end
;
...
...
@@ -713,7 +708,7 @@ UINT load_string_table( MSIDATABASE *db )
codepage
=
pool
[
0
]
|
(
pool
[
1
]
<<
16
);
else
codepage
=
CP_ACP
;
db
->
strings
=
msi_init_stringtable
(
count
,
codepage
);
st
=
msi_init_stringtable
(
count
,
codepage
);
offset
=
0
;
n
=
1
;
...
...
@@ -738,7 +733,7 @@ UINT load_string_table( MSIDATABASE *db )
/* don't add the high word of a string's length as a string */
if
(
len
||
!
pool
[
i
*
2
+
1
]
)
{
r
=
msi_addstring
(
db
->
strings
,
n
,
data
+
offset
,
len
,
pool
[
i
*
2
+
1
]
);
r
=
msi_addstring
(
st
,
n
,
data
+
offset
,
len
,
pool
[
i
*
2
+
1
]
);
if
(
r
!=
n
)
ERR
(
"Failed to add string %ld
\n
"
,
n
);
n
++
;
...
...
@@ -752,13 +747,11 @@ UINT load_string_table( MSIDATABASE *db )
TRACE
(
"Loaded %ld strings
\n
"
,
count
);
ret
=
ERROR_SUCCESS
;
end:
HeapFree
(
GetProcessHeap
(),
0
,
pool
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
return
re
t
;
return
s
t
;
}
static
UINT
save_string_table
(
MSIDATABASE
*
db
)
...
...
@@ -806,7 +799,7 @@ static UINT save_string_table( MSIDATABASE *db )
}
if
(
sz
&&
(
sz
<
(
datasize
-
used
)
)
)
sz
--
;
TRACE
(
"adding %u bytes %s
\n
"
,
sz
,
d
ata
+
used
);
TRACE
(
"adding %u bytes %s
\n
"
,
sz
,
d
ebugstr_a
(
data
+
used
)
);
pool
[
i
*
2
]
=
sz
;
pool
[
i
*
2
+
1
]
=
msi_id_refcount
(
db
->
strings
,
i
);
used
+=
sz
;
...
...
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