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
e261d602
Commit
e261d602
authored
Apr 23, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Apr 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Cleanup unneeded string table functions.
Make string table functions that aren't used outside of string.c static.
parent
37b11baa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
37 deletions
+13
-37
msipriv.h
dlls/msi/msipriv.h
+0
-6
string.c
dlls/msi/string.c
+13
-31
No files found.
dlls/msi/msipriv.h
View file @
e261d602
...
...
@@ -546,21 +546,15 @@ enum StringPersistence
StringNonPersistent
=
1
};
extern
BOOL
msi_addstring
(
string_table
*
st
,
UINT
string_no
,
const
CHAR
*
data
,
int
len
,
UINT
refcount
,
enum
StringPersistence
persistence
);
extern
BOOL
msi_addstringW
(
string_table
*
st
,
UINT
string_no
,
const
WCHAR
*
data
,
int
len
,
UINT
refcount
,
enum
StringPersistence
persistence
);
extern
UINT
msi_id2stringW
(
string_table
*
st
,
UINT
string_no
,
LPWSTR
buffer
,
UINT
*
sz
);
extern
UINT
msi_id2stringA
(
string_table
*
st
,
UINT
string_no
,
LPSTR
buffer
,
UINT
*
sz
);
extern
UINT
msi_string2idW
(
string_table
*
st
,
LPCWSTR
buffer
,
UINT
*
id
);
extern
UINT
msi_string2idA
(
string_table
*
st
,
LPCSTR
str
,
UINT
*
id
);
extern
string_table
*
msi_init_stringtable
(
int
entries
,
UINT
codepage
);
extern
VOID
msi_destroy_stringtable
(
string_table
*
st
);
extern
UINT
msi_string_count
(
string_table
*
st
);
extern
UINT
msi_id_persistent_refcount
(
string_table
*
st
,
UINT
i
);
extern
UINT
msi_string_totalsize
(
string_table
*
st
,
UINT
*
datasize
,
UINT
*
poolsize
);
extern
UINT
msi_strcmp
(
string_table
*
st
,
UINT
lval
,
UINT
rval
,
UINT
*
res
);
extern
const
WCHAR
*
msi_string_lookup_id
(
string_table
*
st
,
UINT
id
);
extern
UINT
msi_string_get_codepage
(
string_table
*
st
);
extern
HRESULT
msi_init_string_table
(
IStorage
*
stg
);
extern
string_table
*
msi_load_string_table
(
IStorage
*
stg
);
extern
UINT
msi_save_string_table
(
string_table
*
st
,
IStorage
*
storage
);
...
...
dlls/msi/string.c
View file @
e261d602
/*
*
Implementation of the Microsoft Installer (msi.dll)
*
String Table Functions
*
* Copyright 2002-2004, Mike McCormack for CodeWeavers
* Copyright 2007 Robert Shearman for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -74,7 +75,7 @@ static UINT msistring_makehash( const WCHAR *str )
return
hash
%
HASH_SIZE
;
}
st
ring_table
*
msi_
init_stringtable
(
int
entries
,
UINT
codepage
)
st
atic
string_table
*
init_stringtable
(
int
entries
,
UINT
codepage
)
{
string_table
*
st
;
int
i
;
...
...
@@ -171,7 +172,7 @@ static void set_st_entry( string_table *st, UINT n, LPWSTR str, UINT refcount, e
st
->
freeslot
=
n
+
1
;
}
int
msi_addstring
(
string_table
*
st
,
UINT
n
,
const
CHAR
*
data
,
int
len
,
UINT
refcount
,
enum
StringPersistence
persistence
)
static
int
msi_addstring
(
string_table
*
st
,
UINT
n
,
const
CHAR
*
data
,
int
len
,
UINT
refcount
,
enum
StringPersistence
persistence
)
{
LPWSTR
str
;
int
sz
;
...
...
@@ -448,19 +449,7 @@ UINT msi_strcmp( string_table *st, UINT lval, UINT rval, UINT *res )
return
ERROR_SUCCESS
;
}
UINT
msi_string_count
(
string_table
*
st
)
{
return
st
->
maxcount
;
}
UINT
msi_id_persistent_refcount
(
string_table
*
st
,
UINT
i
)
{
if
(
i
>=
st
->
maxcount
)
return
0
;
return
st
->
strings
[
i
].
persistent_refcount
;
}
UINT
msi_string_totalsize
(
string_table
*
st
,
UINT
*
datasize
,
UINT
*
poolsize
)
static
void
string_totalsize
(
string_table
*
st
,
UINT
*
datasize
,
UINT
*
poolsize
)
{
UINT
i
,
len
,
max
,
holesize
;
...
...
@@ -493,12 +482,6 @@ UINT msi_string_totalsize( string_table *st, UINT *datasize, UINT *poolsize )
holesize
+=
4
;
}
TRACE
(
"data %u pool %u codepage %x
\n
"
,
*
datasize
,
*
poolsize
,
st
->
codepage
);
return
max
;
}
UINT
msi_string_get_codepage
(
string_table
*
st
)
{
return
st
->
codepage
;
}
static
const
WCHAR
szStringData
[]
=
{
...
...
@@ -544,7 +527,7 @@ string_table *msi_load_string_table( IStorage *stg )
codepage
=
pool
[
0
]
|
(
pool
[
1
]
<<
16
);
else
codepage
=
CP_ACP
;
st
=
msi_
init_stringtable
(
count
,
codepage
);
st
=
init_stringtable
(
count
,
codepage
);
offset
=
0
;
n
=
1
;
...
...
@@ -605,7 +588,7 @@ end:
UINT
msi_save_string_table
(
string_table
*
st
,
IStorage
*
storage
)
{
UINT
i
,
count
,
datasize
=
0
,
poolsize
=
0
,
sz
,
used
,
r
,
codepage
,
n
;
UINT
i
,
datasize
=
0
,
poolsize
=
0
,
sz
,
used
,
r
,
codepage
,
n
;
UINT
ret
=
ERROR_FUNCTION_FAILED
;
CHAR
*
data
=
NULL
;
USHORT
*
pool
=
NULL
;
...
...
@@ -613,9 +596,9 @@ UINT msi_save_string_table( string_table *st, IStorage *storage )
TRACE
(
"
\n
"
);
/* construct the new table in memory first */
count
=
msi_
string_totalsize
(
st
,
&
datasize
,
&
poolsize
);
string_totalsize
(
st
,
&
datasize
,
&
poolsize
);
TRACE
(
"%u %u %u
\n
"
,
count
,
datasize
,
poolsize
);
TRACE
(
"%u %u %u
\n
"
,
st
->
max
count
,
datasize
,
poolsize
);
pool
=
msi_alloc
(
poolsize
);
if
(
!
pool
)
...
...
@@ -631,14 +614,13 @@ UINT msi_save_string_table( string_table *st, IStorage *storage )
}
used
=
0
;
codepage
=
msi_string_get_codepage
(
st
)
;
codepage
=
st
->
codepage
;
pool
[
0
]
=
codepage
&
0xffff
;
pool
[
1
]
=
(
codepage
>>
16
);
n
=
1
;
for
(
i
=
1
;
i
<
count
;
i
++
)
for
(
i
=
1
;
i
<
st
->
max
count
;
i
++
)
{
UINT
refcount
=
msi_id_persistent_refcount
(
st
,
i
);
if
(
!
refcount
)
if
(
!
st
->
strings
[
i
].
persistent_refcount
)
continue
;
sz
=
datasize
-
used
;
r
=
msi_id2stringA
(
st
,
i
,
data
+
used
,
&
sz
);
...
...
@@ -651,7 +633,7 @@ UINT msi_save_string_table( string_table *st, IStorage *storage )
sz
--
;
if
(
sz
)
pool
[
n
*
2
+
1
]
=
refcount
;
pool
[
n
*
2
+
1
]
=
st
->
strings
[
i
].
persistent_
refcount
;
else
pool
[
n
*
2
+
1
]
=
0
;
if
(
sz
<
0x10000
)
...
...
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