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
20dd1886
Commit
20dd1886
authored
Oct 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Split the data conversion functions out of WriteProperty.
parent
ac9d77cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
63 deletions
+79
-63
storage32.c
dlls/ole32/storage32.c
+75
-63
storage32.h
dlls/ole32/storage32.h
+4
-0
No files found.
dlls/ole32/storage32.c
View file @
20dd1886
...
...
@@ -3102,6 +3102,80 @@ HRESULT StorageImpl_WriteRawDirEntry(StorageImpl *This, ULONG index, const BYTE
}
/******************************************************************************
* UpdateRawDirEntry
*
* Update raw directory entry data from the fields in newData.
*
* buffer must be PROPSET_BLOCK_SIZE bytes long.
*/
void
UpdateRawDirEntry
(
BYTE
*
buffer
,
const
StgProperty
*
newData
)
{
memset
(
buffer
,
0
,
PROPSET_BLOCK_SIZE
);
memcpy
(
buffer
+
OFFSET_PS_NAME
,
newData
->
name
,
PROPERTY_NAME_BUFFER_LEN
);
memcpy
(
buffer
+
OFFSET_PS_PROPERTYTYPE
,
&
newData
->
propertyType
,
1
);
StorageUtl_WriteWord
(
buffer
,
OFFSET_PS_NAMELENGTH
,
newData
->
sizeOfNameString
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_LEFTCHILD
,
newData
->
leftChild
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_RIGHTCHILD
,
newData
->
rightChild
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_DIRPROP
,
newData
->
dirProperty
);
StorageUtl_WriteGUID
(
buffer
,
OFFSET_PS_GUID
,
&
newData
->
propertyUniqueID
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_CTIMELOW
,
newData
->
ctime
.
dwLowDateTime
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_CTIMEHIGH
,
newData
->
ctime
.
dwHighDateTime
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_MTIMELOW
,
newData
->
mtime
.
dwLowDateTime
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_MTIMEHIGH
,
newData
->
ctime
.
dwHighDateTime
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_STARTBLOCK
,
newData
->
startingBlock
);
StorageUtl_WriteDWord
(
buffer
,
OFFSET_PS_SIZE
,
newData
->
size
.
u
.
LowPart
);
}
/******************************************************************************
* Storage32Impl_ReadProperty
*
* This method will read the specified property from the property chain.
...
...
@@ -3203,69 +3277,7 @@ BOOL StorageImpl_WriteProperty(
BYTE
currentProperty
[
PROPSET_BLOCK_SIZE
];
HRESULT
writeRes
;
memset
(
currentProperty
,
0
,
PROPSET_BLOCK_SIZE
);
memcpy
(
currentProperty
+
OFFSET_PS_NAME
,
buffer
->
name
,
PROPERTY_NAME_BUFFER_LEN
);
memcpy
(
currentProperty
+
OFFSET_PS_PROPERTYTYPE
,
&
buffer
->
propertyType
,
1
);
StorageUtl_WriteWord
(
currentProperty
,
OFFSET_PS_NAMELENGTH
,
buffer
->
sizeOfNameString
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_LEFTCHILD
,
buffer
->
leftChild
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_RIGHTCHILD
,
buffer
->
rightChild
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_DIRPROP
,
buffer
->
dirProperty
);
StorageUtl_WriteGUID
(
currentProperty
,
OFFSET_PS_GUID
,
&
buffer
->
propertyUniqueID
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_CTIMELOW
,
buffer
->
ctime
.
dwLowDateTime
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_CTIMEHIGH
,
buffer
->
ctime
.
dwHighDateTime
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_MTIMELOW
,
buffer
->
mtime
.
dwLowDateTime
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_MTIMEHIGH
,
buffer
->
ctime
.
dwHighDateTime
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_STARTBLOCK
,
buffer
->
startingBlock
);
StorageUtl_WriteDWord
(
currentProperty
,
OFFSET_PS_SIZE
,
buffer
->
size
.
u
.
LowPart
);
UpdateRawDirEntry
(
currentProperty
,
buffer
);
writeRes
=
StorageImpl_WriteRawDirEntry
(
This
,
index
,
currentProperty
);
return
SUCCEEDED
(
writeRes
)
?
TRUE
:
FALSE
;
...
...
dlls/ole32/storage32.h
View file @
20dd1886
...
...
@@ -295,6 +295,10 @@ HRESULT StorageImpl_ReadRawDirEntry(
ULONG
index
,
BYTE
*
buffer
);
void
UpdateRawDirEntry
(
BYTE
*
buffer
,
const
StgProperty
*
newData
);
HRESULT
StorageImpl_WriteRawDirEntry
(
StorageImpl
*
This
,
ULONG
index
,
...
...
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