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
ff87ad7a
Commit
ff87ad7a
authored
May 16, 2005
by
Juan Lang
Committed by
Alexandre Julliard
May 16, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a comment, and a no-op cleanup.
parent
6186b2be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
stg_prop.c
dlls/ole32/stg_prop.c
+19
-18
No files found.
dlls/ole32/stg_prop.c
View file @
ff87ad7a
...
...
@@ -37,6 +37,8 @@
* endian, because I disregard whether the generator was a Mac. This means
* strings will probably be munged (as I don't understand Mac scripts.)
* - Not all PROPVARIANT types are supported.
* - User defined properties are not supported, see comment in
* PropertyStorage_ReadFromStream
* - IPropertyStorage::Enum is unimplemented
*/
...
...
@@ -142,8 +144,8 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
* is CP_UNICODE, the returned string is in fact an LPWSTR.
* Returns S_OK on success, something else on failure.
*/
static
HRESULT
PropertyStorage_StringCopy
(
LPCSTR
src
,
L
PSTR
*
dst
,
LCID
targetCP
,
LCID
src
CP
);
static
HRESULT
PropertyStorage_StringCopy
(
LPCSTR
src
,
L
CID
srcCP
,
LPSTR
*
dst
,
LCID
target
CP
);
static
IPropertyStorageVtbl
IPropertyStorage_Vtbl
;
...
...
@@ -259,8 +261,8 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
else
{
LPSTR
ansiName
;
HRESULT
hr
=
PropertyStorage_StringCopy
((
LPCSTR
)
name
,
&
ansiName
,
This
->
codePage
,
CP_UNICODE
);
HRESULT
hr
=
PropertyStorage_StringCopy
((
LPCSTR
)
name
,
CP_UNICODE
,
&
ansiName
,
This
->
codePage
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -344,24 +346,23 @@ static HRESULT WINAPI IPropertyStorage_fnReadMultiple(
return
hr
;
}
/* FIXME: the arguments are in a screwy order here, bub. */
static
HRESULT
PropertyStorage_StringCopy
(
LPCSTR
src
,
LPSTR
*
dst
,
LCID
targetCP
,
LCID
srcCP
)
static
HRESULT
PropertyStorage_StringCopy
(
LPCSTR
src
,
LCID
srcCP
,
LPSTR
*
dst
,
LCID
dstCP
)
{
HRESULT
hr
=
S_OK
;
int
len
;
TRACE
(
"%s, %p, %ld, %ld
\n
"
,
srcCP
==
CP_UNICODE
?
debugstr_w
((
LPCWSTR
)
src
)
:
debugstr_a
(
src
),
dst
,
targe
tCP
,
srcCP
);
ds
tCP
,
srcCP
);
assert
(
src
);
assert
(
dst
);
*
dst
=
NULL
;
if
(
targe
tCP
==
srcCP
)
if
(
ds
tCP
==
srcCP
)
{
size_t
len
;
if
(
targe
tCP
==
CP_UNICODE
)
if
(
ds
tCP
==
CP_UNICODE
)
len
=
(
strlenW
((
LPCWSTR
)
src
)
+
1
)
*
sizeof
(
WCHAR
);
else
len
=
strlen
(
src
)
+
1
;
...
...
@@ -373,7 +374,7 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LPSTR *dst, LCID targetCP,
}
else
{
if
(
targe
tCP
==
CP_UNICODE
)
if
(
ds
tCP
==
CP_UNICODE
)
{
len
=
MultiByteToWideChar
(
srcCP
,
0
,
src
,
-
1
,
NULL
,
0
);
*
dst
=
CoTaskMemAlloc
(
len
*
sizeof
(
WCHAR
));
...
...
@@ -399,7 +400,7 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LPSTR *dst, LCID targetCP,
}
if
(
SUCCEEDED
(
hr
))
{
len
=
WideCharToMultiByte
(
targe
tCP
,
0
,
wideStr
,
-
1
,
NULL
,
0
,
len
=
WideCharToMultiByte
(
ds
tCP
,
0
,
wideStr
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
*
dst
=
CoTaskMemAlloc
(
len
);
if
(
!*
dst
)
...
...
@@ -408,8 +409,8 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LPSTR *dst, LCID targetCP,
{
BOOL
defCharUsed
=
FALSE
;
if
(
WideCharToMultiByte
(
targetCP
,
0
,
wideStr
,
-
1
,
*
dst
,
len
,
NULL
,
&
defCharUsed
)
==
0
||
defCharUsed
)
if
(
WideCharToMultiByte
(
dstCP
,
0
,
wideStr
,
-
1
,
*
dst
,
len
,
NULL
,
&
defCharUsed
)
==
0
||
defCharUsed
)
{
CoTaskMemFree
(
*
dst
);
*
dst
=
NULL
;
...
...
@@ -422,7 +423,7 @@ static HRESULT PropertyStorage_StringCopy(LPCSTR src, LPSTR *dst, LCID targetCP,
}
}
TRACE
(
"returning 0x%08lx (%s)
\n
"
,
hr
,
targe
tCP
==
CP_UNICODE
?
debugstr_w
((
LPCWSTR
)
*
dst
)
:
debugstr_a
(
*
dst
));
ds
tCP
==
CP_UNICODE
?
debugstr_w
((
LPCWSTR
)
*
dst
)
:
debugstr_a
(
*
dst
));
return
hr
;
}
...
...
@@ -435,8 +436,8 @@ static HRESULT PropertyStorage_PropVariantCopy(PROPVARIANT *prop,
assert
(
propvar
);
if
(
propvar
->
vt
==
VT_LPSTR
)
{
hr
=
PropertyStorage_StringCopy
(
propvar
->
u
.
pszVal
,
&
prop
->
u
.
pszVal
,
targetCP
,
src
CP
);
hr
=
PropertyStorage_StringCopy
(
propvar
->
u
.
pszVal
,
srcCP
,
&
prop
->
u
.
pszVal
,
target
CP
);
if
(
SUCCEEDED
(
hr
))
prop
->
vt
=
VT_LPSTR
;
}
...
...
@@ -516,7 +517,7 @@ static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This,
assert
(
srcName
);
hr
=
PropertyStorage_StringCopy
((
LPCSTR
)
srcName
,
&
name
,
This
->
codePage
,
cp
);
hr
=
PropertyStorage_StringCopy
((
LPCSTR
)
srcName
,
cp
,
&
name
,
This
->
codePage
);
if
(
SUCCEEDED
(
hr
))
{
if
(
This
->
codePage
==
CP_UNICODE
)
...
...
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