Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
c0523aaa
Commit
c0523aaa
authored
20 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
20 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Pull the codepage from the string table.
parent
fb3f40b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/msi/msipriv.h
+1
-1
1 addition, 1 deletion
dlls/msi/msipriv.h
dlls/msi/string.c
+9
-7
9 additions, 7 deletions
dlls/msi/string.c
dlls/msi/table.c
+3
-3
3 additions, 3 deletions
dlls/msi/table.c
with
13 additions
and
11 deletions
dlls/msi/msipriv.h
+
1
−
1
View file @
c0523aaa
...
...
@@ -186,7 +186,7 @@ extern UINT msi_id2stringA( string_table *st, UINT string_no, LPSTR buffer, UINT
extern
LPWSTR
MSI_makestring
(
MSIDATABASE
*
db
,
UINT
stringid
);
extern
UINT
msi_string2id
(
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
);
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_refcount
(
string_table
*
st
,
UINT
i
);
...
...
This diff is collapsed.
Click to expand it.
dlls/msi/string.c
+
9
−
7
View file @
c0523aaa
...
...
@@ -47,6 +47,7 @@ struct string_table
{
UINT
count
;
/* the number of strings */
UINT
freeslot
;
UINT
codepage
;
msistring
*
strings
;
/* an array of strings (in the tree) */
};
...
...
@@ -63,7 +64,7 @@ static int msistring_makehash( const char *str )
return
hash
;
}
string_table
*
msi_init_stringtable
(
int
entries
)
string_table
*
msi_init_stringtable
(
int
entries
,
UINT
codepage
)
{
string_table
*
st
;
...
...
@@ -79,6 +80,7 @@ string_table *msi_init_stringtable( int entries )
}
st
->
count
=
entries
;
st
->
freeslot
=
1
;
st
->
codepage
=
codepage
;
return
st
;
}
...
...
@@ -192,11 +194,11 @@ int msi_addstringW( string_table *st, UINT n, const WCHAR *data, UINT len, UINT
}
/* allocate a new string */
sz
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
data
,
len
,
NULL
,
0
,
NULL
,
NULL
);
sz
=
WideCharToMultiByte
(
st
->
codepage
,
0
,
data
,
len
,
NULL
,
0
,
NULL
,
NULL
);
st
->
strings
[
n
].
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
+
1
);
if
(
!
st
->
strings
[
n
].
str
)
return
-
1
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
data
,
len
,
WideCharToMultiByte
(
st
->
codepage
,
0
,
data
,
len
,
st
->
strings
[
n
].
str
,
sz
,
NULL
,
NULL
);
st
->
strings
[
n
].
str
[
sz
]
=
0
;
st
->
strings
[
n
].
refcount
=
1
;
...
...
@@ -245,7 +247,7 @@ UINT msi_id2stringW( string_table *st, UINT id, LPWSTR buffer, UINT *sz )
if
(
!
str
)
return
ERROR_FUNCTION_FAILED
;
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
);
len
=
MultiByteToWideChar
(
st
->
codepage
,
0
,
str
,
-
1
,
NULL
,
0
);
if
(
!
buffer
)
{
...
...
@@ -253,7 +255,7 @@ UINT msi_id2stringW( string_table *st, UINT id, LPWSTR buffer, UINT *sz )
return
ERROR_SUCCESS
;
}
*
sz
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
buffer
,
*
sz
);
*
sz
=
MultiByteToWideChar
(
st
->
codepage
,
0
,
str
,
-
1
,
buffer
,
*
sz
);
return
ERROR_SUCCESS
;
}
...
...
@@ -338,13 +340,13 @@ UINT msi_string2id( string_table *st, LPCWSTR buffer, UINT *id )
return
ERROR_SUCCESS
;
}
sz
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
buffer
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
sz
=
WideCharToMultiByte
(
st
->
codepage
,
0
,
buffer
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
sz
<=
0
)
return
r
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
if
(
!
str
)
return
ERROR_NOT_ENOUGH_MEMORY
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
buffer
,
-
1
,
str
,
sz
,
NULL
,
NULL
);
WideCharToMultiByte
(
st
->
codepage
,
0
,
buffer
,
-
1
,
str
,
sz
,
NULL
,
NULL
);
r
=
msi_string2idA
(
st
,
str
,
id
);
if
(
str
)
...
...
This diff is collapsed.
Click to expand it.
dlls/msi/table.c
+
3
−
3
View file @
c0523aaa
...
...
@@ -612,10 +612,10 @@ UINT load_string_table( MSIDATABASE *db )
goto
end
;
count
=
poolsize
/
4
;
db
->
strings
=
msi_init_stringtable
(
count
);
db
->
strings
=
msi_init_stringtable
(
count
,
pool
[
0
]
);
if
(
pool
[
0
]
||
pool
[
1
]
)
ERR
(
"The first string should
be nul
, but
i
sn't
\n
"
);
if
(
pool
[
1
]
)
ERR
(
"The first string should
have zero refcount
, but
doe
sn't
%04x
\n
"
,
pool
[
1
]
);
offset
=
0
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment