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
ce60cfeb
Commit
ce60cfeb
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 FmtIdToPropStgName from ole32.
parent
7478f15f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
68 deletions
+126
-68
Makefile.in
dlls/coml2/Makefile.in
+1
-0
coml2.spec
dlls/coml2/coml2.spec
+1
-1
stg_prop.c
dlls/coml2/stg_prop.c
+124
-0
stg_prop.c
dlls/ole32/stg_prop.c
+0
-67
No files found.
dlls/coml2/Makefile.in
View file @
ce60cfeb
...
...
@@ -5,4 +5,5 @@ IMPORTS = uuid
SOURCES
=
\
memlockbytes.c
\
stg_prop.c
\
storage32.c
dlls/coml2/coml2.spec
View file @
ce60cfeb
...
...
@@ -11,7 +11,7 @@
@ stub Coml2DllGetClassObject
@ stdcall CreateILockBytesOnHGlobal(ptr long ptr)
@ stub DllGetClassObject
@ st
ub FmtIdToPropStgName
@ st
dcall FmtIdToPropStgName(ptr wstr)
@ stdcall GetConvertStg(ptr)
@ stdcall GetHGlobalFromILockBytes(ptr ptr)
@ stub PropStgNameToFmtId
...
...
dlls/coml2/stg_prop.c
0 → 100644
View file @
ce60cfeb
/*
* Compound Storage (32 bit version)
* Storage implementation
*
* This file contains the compound file implementation
* of the storage interface.
*
* Copyright 1999 Francis Beaudet
* Copyright 1999 Sylvain St-Germain
* Copyright 1999 Thuy Nguyen
* Copyright 2005 Mike McCormack
* Copyright 2005 Juan Lang
* Copyright 2006 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* TODO:
* - I don't honor the maximum property set size.
* - Certain bogus files could result in reading past the end of a buffer.
* - Mac-generated files won't be read correctly, even if they're little
* 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
*/
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "oleauto.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
storage
);
/***********************************************************************
* 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
/***********************************************************************
* FmtIdToPropStgName [coml2.@]
*/
HRESULT
WINAPI
FmtIdToPropStgName
(
const
FMTID
*
rfmtid
,
LPOLESTR
str
)
{
static
const
char
fmtMap
[]
=
"abcdefghijklmnopqrstuvwxyz012345"
;
TRACE
(
"%s, %p
\n
"
,
debugstr_guid
(
rfmtid
),
str
);
if
(
!
rfmtid
)
return
E_INVALIDARG
;
if
(
!
str
)
return
E_INVALIDARG
;
if
(
IsEqualGUID
(
&
FMTID_SummaryInformation
,
rfmtid
))
lstrcpyW
(
str
,
szSummaryInfo
);
else
if
(
IsEqualGUID
(
&
FMTID_DocSummaryInformation
,
rfmtid
))
lstrcpyW
(
str
,
szDocSummaryInfo
);
else
if
(
IsEqualGUID
(
&
FMTID_UserDefinedProperties
,
rfmtid
))
lstrcpyW
(
str
,
szDocSummaryInfo
);
else
{
const
BYTE
*
fmtptr
;
WCHAR
*
pstr
=
str
;
ULONG
bitsRemaining
=
BITS_PER_BYTE
;
*
pstr
++
=
5
;
for
(
fmtptr
=
(
const
BYTE
*
)
rfmtid
;
fmtptr
<
(
const
BYTE
*
)
rfmtid
+
sizeof
(
FMTID
);
)
{
ULONG
i
=
*
fmtptr
>>
(
BITS_PER_BYTE
-
bitsRemaining
);
if
(
bitsRemaining
>=
BITS_IN_CHARMASK
)
{
*
pstr
=
(
WCHAR
)(
fmtMap
[
i
&
CHARMASK
]);
if
(
bitsRemaining
==
BITS_PER_BYTE
&&
*
pstr
>=
'a'
&&
*
pstr
<=
'z'
)
*
pstr
+=
'A'
-
'a'
;
pstr
++
;
bitsRemaining
-=
BITS_IN_CHARMASK
;
if
(
bitsRemaining
==
0
)
{
fmtptr
++
;
bitsRemaining
=
BITS_PER_BYTE
;
}
}
else
{
if
(
++
fmtptr
<
(
const
BYTE
*
)
rfmtid
+
sizeof
(
FMTID
))
i
|=
*
fmtptr
<<
bitsRemaining
;
*
pstr
++
=
(
WCHAR
)(
fmtMap
[
i
&
CHARMASK
]);
bitsRemaining
+=
BITS_PER_BYTE
-
BITS_IN_CHARMASK
;
}
}
*
pstr
=
0
;
}
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
str
));
return
S_OK
;
}
dlls/ole32/stg_prop.c
View file @
ce60cfeb
...
...
@@ -3006,73 +3006,6 @@ static const WCHAR szDocSummaryInfo[] = L"\5DocumentSummaryInformation";
#define NUM_ALPHA_CHARS 26
/***********************************************************************
* FmtIdToPropStgName [ole32.@]
* Returns the storage name of the format ID rfmtid.
* PARAMS
* rfmtid [I] Format ID for which to return a storage name
* str [O] Storage name associated with rfmtid.
*
* RETURNS
* E_INVALIDARG if rfmtid or str i NULL, S_OK otherwise.
*
* NOTES
* str must be at least CCH_MAX_PROPSTG_NAME characters in length.
*/
HRESULT
WINAPI
FmtIdToPropStgName
(
const
FMTID
*
rfmtid
,
LPOLESTR
str
)
{
static
const
char
fmtMap
[]
=
"abcdefghijklmnopqrstuvwxyz012345"
;
TRACE
(
"%s, %p
\n
"
,
debugstr_guid
(
rfmtid
),
str
);
if
(
!
rfmtid
)
return
E_INVALIDARG
;
if
(
!
str
)
return
E_INVALIDARG
;
if
(
IsEqualGUID
(
&
FMTID_SummaryInformation
,
rfmtid
))
lstrcpyW
(
str
,
szSummaryInfo
);
else
if
(
IsEqualGUID
(
&
FMTID_DocSummaryInformation
,
rfmtid
))
lstrcpyW
(
str
,
szDocSummaryInfo
);
else
if
(
IsEqualGUID
(
&
FMTID_UserDefinedProperties
,
rfmtid
))
lstrcpyW
(
str
,
szDocSummaryInfo
);
else
{
const
BYTE
*
fmtptr
;
WCHAR
*
pstr
=
str
;
ULONG
bitsRemaining
=
BITS_PER_BYTE
;
*
pstr
++
=
5
;
for
(
fmtptr
=
(
const
BYTE
*
)
rfmtid
;
fmtptr
<
(
const
BYTE
*
)
rfmtid
+
sizeof
(
FMTID
);
)
{
ULONG
i
=
*
fmtptr
>>
(
BITS_PER_BYTE
-
bitsRemaining
);
if
(
bitsRemaining
>=
BITS_IN_CHARMASK
)
{
*
pstr
=
(
WCHAR
)(
fmtMap
[
i
&
CHARMASK
]);
if
(
bitsRemaining
==
BITS_PER_BYTE
&&
*
pstr
>=
'a'
&&
*
pstr
<=
'z'
)
*
pstr
+=
'A'
-
'a'
;
pstr
++
;
bitsRemaining
-=
BITS_IN_CHARMASK
;
if
(
bitsRemaining
==
0
)
{
fmtptr
++
;
bitsRemaining
=
BITS_PER_BYTE
;
}
}
else
{
if
(
++
fmtptr
<
(
const
BYTE
*
)
rfmtid
+
sizeof
(
FMTID
))
i
|=
*
fmtptr
<<
bitsRemaining
;
*
pstr
++
=
(
WCHAR
)(
fmtMap
[
i
&
CHARMASK
]);
bitsRemaining
+=
BITS_PER_BYTE
-
BITS_IN_CHARMASK
;
}
}
*
pstr
=
0
;
}
TRACE
(
"returning %s
\n
"
,
debugstr_w
(
str
));
return
S_OK
;
}
/***********************************************************************
* PropStgNameToFmtId [ole32.@]
* Returns the format ID corresponding to the given name.
* PARAMS
...
...
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