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
6c3961f0
Commit
6c3961f0
authored
Nov 23, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Copy the storage filename at stat time, not read time.
parent
9943facb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
stg_stream.c
dlls/ole32/stg_stream.c
+2
-1
storage32.c
dlls/ole32/storage32.c
+21
-10
storage32.h
dlls/ole32/storage32.h
+2
-2
No files found.
dlls/ole32/stg_stream.c
View file @
6c3961f0
...
@@ -860,7 +860,8 @@ static HRESULT WINAPI StgStreamImpl_Stat(
...
@@ -860,7 +860,8 @@ static HRESULT WINAPI StgStreamImpl_Stat(
{
{
StorageImpl
*
root
=
This
->
parentStorage
->
ancestorStorage
;
StorageImpl
*
root
=
This
->
parentStorage
->
ancestorStorage
;
StorageUtl_CopyDirEntryToSTATSTG
(
pstatstg
,
StorageUtl_CopyDirEntryToSTATSTG
(
root
,
pstatstg
,
&
currentEntry
,
&
currentEntry
,
grfStatFlag
);
grfStatFlag
);
...
...
dlls/ole32/storage32.c
View file @
6c3961f0
...
@@ -698,6 +698,7 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
...
@@ -698,6 +698,7 @@ static HRESULT WINAPI StorageBaseImpl_Stat(
if
(
readSuccessful
)
if
(
readSuccessful
)
{
{
StorageUtl_CopyDirEntryToSTATSTG
(
StorageUtl_CopyDirEntryToSTATSTG
(
This
->
ancestorStorage
,
pstatstg
,
pstatstg
,
&
currentEntry
,
&
currentEntry
,
grfStatFlag
);
grfStatFlag
);
...
@@ -3241,14 +3242,10 @@ BOOL StorageImpl_ReadDirEntry(
...
@@ -3241,14 +3242,10 @@ BOOL StorageImpl_ReadDirEntry(
if
(
SUCCEEDED
(
readRes
))
if
(
SUCCEEDED
(
readRes
))
{
{
/* replace the name of root entry (often "Root Entry") by the file name */
WCHAR
*
entryName
=
(
index
==
This
->
base
.
storageDirEntry
)
?
This
->
filename
:
(
WCHAR
*
)
currentEntry
+
OFFSET_PS_NAME
;
memset
(
buffer
->
name
,
0
,
sizeof
(
buffer
->
name
));
memset
(
buffer
->
name
,
0
,
sizeof
(
buffer
->
name
));
memcpy
(
memcpy
(
buffer
->
name
,
buffer
->
name
,
entryName
,
(
WCHAR
*
)
currentEntry
+
OFFSET_PS_NAME
,
DIRENTRY_NAME_BUFFER_LEN
);
DIRENTRY_NAME_BUFFER_LEN
);
TRACE
(
"storage name: %s
\n
"
,
debugstr_w
(
buffer
->
name
));
TRACE
(
"storage name: %s
\n
"
,
debugstr_w
(
buffer
->
name
));
...
@@ -3750,7 +3747,8 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Next(
...
@@ -3750,7 +3747,8 @@ static HRESULT WINAPI IEnumSTATSTGImpl_Next(
/*
/*
* Copy the information to the return buffer.
* Copy the information to the return buffer.
*/
*/
StorageUtl_CopyDirEntryToSTATSTG
(
currentReturnStruct
,
StorageUtl_CopyDirEntryToSTATSTG
(
This
->
parentStorage
,
currentReturnStruct
,
&
currentEntry
,
&
currentEntry
,
STATFLAG_DEFAULT
);
STATFLAG_DEFAULT
);
...
@@ -4179,25 +4177,38 @@ void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value)
...
@@ -4179,25 +4177,38 @@ void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value)
}
}
void
StorageUtl_CopyDirEntryToSTATSTG
(
void
StorageUtl_CopyDirEntryToSTATSTG
(
StorageImpl
*
storage
,
STATSTG
*
destination
,
STATSTG
*
destination
,
const
DirEntry
*
source
,
const
DirEntry
*
source
,
int
statFlags
)
int
statFlags
)
{
{
LPCWSTR
entryName
;
if
(
source
->
stgType
==
STGTY_ROOT
)
{
/* replace the name of root entry (often "Root Entry") by the file name */
entryName
=
storage
->
filename
;
}
else
{
entryName
=
source
->
name
;
}
/*
/*
* The copy of the string occurs only when the flag is not set
* The copy of the string occurs only when the flag is not set
*/
*/
if
(
((
statFlags
&
STATFLAG_NONAME
)
!=
0
)
||
if
(
((
statFlags
&
STATFLAG_NONAME
)
!=
0
)
||
(
source
->
name
==
NULL
)
||
(
entryName
==
NULL
)
||
(
source
->
n
ame
[
0
]
==
0
)
)
(
entryN
ame
[
0
]
==
0
)
)
{
{
destination
->
pwcsName
=
0
;
destination
->
pwcsName
=
0
;
}
}
else
else
{
{
destination
->
pwcsName
=
destination
->
pwcsName
=
CoTaskMemAlloc
((
lstrlenW
(
source
->
n
ame
)
+
1
)
*
sizeof
(
WCHAR
));
CoTaskMemAlloc
((
lstrlenW
(
entryN
ame
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
destination
->
pwcsName
,
source
->
n
ame
);
strcpyW
(
destination
->
pwcsName
,
entryN
ame
);
}
}
switch
(
source
->
stgType
)
switch
(
source
->
stgType
)
...
...
dlls/ole32/storage32.h
View file @
6c3961f0
...
@@ -428,8 +428,8 @@ void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
...
@@ -428,8 +428,8 @@ void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset,
const
ULARGE_INTEGER
*
value
);
const
ULARGE_INTEGER
*
value
);
void
StorageUtl_ReadGUID
(
const
BYTE
*
buffer
,
ULONG
offset
,
GUID
*
value
);
void
StorageUtl_ReadGUID
(
const
BYTE
*
buffer
,
ULONG
offset
,
GUID
*
value
);
void
StorageUtl_WriteGUID
(
BYTE
*
buffer
,
ULONG
offset
,
const
GUID
*
value
);
void
StorageUtl_WriteGUID
(
BYTE
*
buffer
,
ULONG
offset
,
const
GUID
*
value
);
void
StorageUtl_CopyDirEntryToSTATSTG
(
S
TATSTG
*
destination
,
const
DirEntry
*
source
,
void
StorageUtl_CopyDirEntryToSTATSTG
(
S
torageImpl
*
storage
,
STATSTG
*
destination
,
int
statFlags
);
const
DirEntry
*
source
,
int
statFlags
);
/****************************************************************************
/****************************************************************************
* BlockChainStream definitions.
* BlockChainStream definitions.
...
...
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