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
e5df1b2e
Commit
e5df1b2e
authored
Dec 03, 2023
by
Fabian Maurer
Committed by
Alexandre Julliard
Dec 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coml2: Move PropStgNameToFmtId from ole32.
parent
ce60cfeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
95 deletions
+76
-95
coml2.spec
dlls/coml2/coml2.spec
+1
-1
stg_prop.c
dlls/coml2/stg_prop.c
+75
-0
stg_prop.c
dlls/ole32/stg_prop.c
+0
-94
No files found.
dlls/coml2/coml2.spec
View file @
e5df1b2e
...
...
@@ -14,7 +14,7 @@
@ stdcall FmtIdToPropStgName(ptr wstr)
@ stdcall GetConvertStg(ptr)
@ stdcall GetHGlobalFromILockBytes(ptr ptr)
@ st
ub PropStgNameToFmtId
@ st
dcall PropStgNameToFmtId(wstr ptr)
@ stdcall ReadClassStg(ptr ptr)
@ stdcall ReadClassStm(ptr ptr)
@ stub StgCreateDocfile
...
...
dlls/coml2/stg_prop.c
View file @
e5df1b2e
...
...
@@ -122,3 +122,78 @@ HRESULT WINAPI FmtIdToPropStgName(const FMTID *rfmtid, LPOLESTR str)
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
str
));
return
S_OK
;
}
/***********************************************************************
* PropStgNameToFmtId [coml2.@]
*/
HRESULT
WINAPI
PropStgNameToFmtId
(
const
LPOLESTR
str
,
FMTID
*
rfmtid
)
{
HRESULT
hr
=
STG_E_INVALIDNAME
;
TRACE
(
"%s, %p
\n
"
,
debugstr_w
(
str
),
rfmtid
);
if
(
!
rfmtid
)
return
E_INVALIDARG
;
if
(
!
str
)
return
STG_E_INVALIDNAME
;
if
(
!
lstrcmpiW
(
str
,
szDocSummaryInfo
))
{
*
rfmtid
=
FMTID_DocSummaryInformation
;
hr
=
S_OK
;
}
else
if
(
!
lstrcmpiW
(
str
,
szSummaryInfo
))
{
*
rfmtid
=
FMTID_SummaryInformation
;
hr
=
S_OK
;
}
else
{
ULONG
bits
;
BYTE
*
fmtptr
=
(
BYTE
*
)
rfmtid
-
1
;
const
WCHAR
*
pstr
=
str
;
memset
(
rfmtid
,
0
,
sizeof
(
*
rfmtid
));
for
(
bits
=
0
;
bits
<
sizeof
(
FMTID
)
*
BITS_PER_BYTE
;
bits
+=
BITS_IN_CHARMASK
)
{
ULONG
bitsUsed
=
bits
%
BITS_PER_BYTE
,
bitsStored
;
WCHAR
wc
;
if
(
bitsUsed
==
0
)
fmtptr
++
;
wc
=
*++
pstr
-
'A'
;
if
(
wc
>
NUM_ALPHA_CHARS
)
{
wc
+=
'A'
-
'a'
;
if
(
wc
>
NUM_ALPHA_CHARS
)
{
wc
+=
'a'
-
'0'
+
NUM_ALPHA_CHARS
;
if
(
wc
>
CHARMASK
)
{
WARN
(
"invalid character (%d)
\n
"
,
*
pstr
);
goto
end
;
}
}
}
*
fmtptr
|=
wc
<<
bitsUsed
;
bitsStored
=
min
(
BITS_PER_BYTE
-
bitsUsed
,
BITS_IN_CHARMASK
);
if
(
bitsStored
<
BITS_IN_CHARMASK
)
{
wc
>>=
BITS_PER_BYTE
-
bitsUsed
;
if
(
bits
+
bitsStored
==
sizeof
(
FMTID
)
*
BITS_PER_BYTE
)
{
if
(
wc
!=
0
)
{
WARN
(
"extra bits
\n
"
);
goto
end
;
}
break
;
}
fmtptr
++
;
*
fmtptr
|=
(
BYTE
)
wc
;
}
}
hr
=
S_OK
;
}
end:
return
hr
;
}
dlls/ole32/stg_prop.c
View file @
e5df1b2e
...
...
@@ -2994,100 +2994,6 @@ static const IPropertyStorageVtbl IPropertyStorage_Vtbl =
IPropertyStorage_fnStat
,
};
/***********************************************************************
* Format ID <-> name conversion
*/
static
const
WCHAR
szSummaryInfo
[]
=
L"
\5
SummaryInformation"
;
static
const
WCHAR
szDocSummaryInfo
[]
=
L"
\5
DocumentSummaryInformation"
;
#define BITS_PER_BYTE 8
#define CHARMASK 0x1f
#define BITS_IN_CHARMASK 5
#define NUM_ALPHA_CHARS 26
/***********************************************************************
* PropStgNameToFmtId [ole32.@]
* Returns the format ID corresponding to the given name.
* PARAMS
* str [I] Storage name to convert to a format ID.
* rfmtid [O] Format ID corresponding to str.
*
* RETURNS
* E_INVALIDARG if rfmtid or str is NULL or if str can't be converted to
* a format ID, S_OK otherwise.
*/
HRESULT
WINAPI
PropStgNameToFmtId
(
const
LPOLESTR
str
,
FMTID
*
rfmtid
)
{
HRESULT
hr
=
STG_E_INVALIDNAME
;
TRACE
(
"%s, %p
\n
"
,
debugstr_w
(
str
),
rfmtid
);
if
(
!
rfmtid
)
return
E_INVALIDARG
;
if
(
!
str
)
return
STG_E_INVALIDNAME
;
if
(
!
lstrcmpiW
(
str
,
szDocSummaryInfo
))
{
*
rfmtid
=
FMTID_DocSummaryInformation
;
hr
=
S_OK
;
}
else
if
(
!
lstrcmpiW
(
str
,
szSummaryInfo
))
{
*
rfmtid
=
FMTID_SummaryInformation
;
hr
=
S_OK
;
}
else
{
ULONG
bits
;
BYTE
*
fmtptr
=
(
BYTE
*
)
rfmtid
-
1
;
const
WCHAR
*
pstr
=
str
;
memset
(
rfmtid
,
0
,
sizeof
(
*
rfmtid
));
for
(
bits
=
0
;
bits
<
sizeof
(
FMTID
)
*
BITS_PER_BYTE
;
bits
+=
BITS_IN_CHARMASK
)
{
ULONG
bitsUsed
=
bits
%
BITS_PER_BYTE
,
bitsStored
;
WCHAR
wc
;
if
(
bitsUsed
==
0
)
fmtptr
++
;
wc
=
*++
pstr
-
'A'
;
if
(
wc
>
NUM_ALPHA_CHARS
)
{
wc
+=
'A'
-
'a'
;
if
(
wc
>
NUM_ALPHA_CHARS
)
{
wc
+=
'a'
-
'0'
+
NUM_ALPHA_CHARS
;
if
(
wc
>
CHARMASK
)
{
WARN
(
"invalid character (%d)
\n
"
,
*
pstr
);
goto
end
;
}
}
}
*
fmtptr
|=
wc
<<
bitsUsed
;
bitsStored
=
min
(
BITS_PER_BYTE
-
bitsUsed
,
BITS_IN_CHARMASK
);
if
(
bitsStored
<
BITS_IN_CHARMASK
)
{
wc
>>=
BITS_PER_BYTE
-
bitsUsed
;
if
(
bits
+
bitsStored
==
sizeof
(
FMTID
)
*
BITS_PER_BYTE
)
{
if
(
wc
!=
0
)
{
WARN
(
"extra bits
\n
"
);
goto
end
;
}
break
;
}
fmtptr
++
;
*
fmtptr
|=
(
BYTE
)
wc
;
}
}
hr
=
S_OK
;
}
end:
return
hr
;
}
#ifdef __i386__
/* thiscall functions are i386-specific */
#define DEFINE_STDCALL_WRAPPER(num,func,args) \
...
...
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