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
f1861166
Commit
f1861166
authored
Nov 12, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Rename property variables in internal storage functions.
parent
b984e46b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
56 deletions
+56
-56
storage32.c
dlls/ole32/storage32.c
+56
-56
No files found.
dlls/ole32/storage32.c
View file @
f1861166
...
...
@@ -1093,8 +1093,8 @@ static HRESULT createDirEntry(
const
DirEntry
*
newData
,
ULONG
*
index
)
{
ULONG
current
PropertyIndex
=
0
;
ULONG
new
PropertyIndex
=
DIRENTRY_NULL
;
ULONG
current
EntryIndex
=
0
;
ULONG
new
EntryIndex
=
DIRENTRY_NULL
;
HRESULT
hr
=
S_OK
;
BYTE
currentData
[
RAW_DIRENTRY_SIZE
];
WORD
sizeOfNameString
;
...
...
@@ -1102,7 +1102,7 @@ static HRESULT createDirEntry(
do
{
hr
=
StorageImpl_ReadRawDirEntry
(
storage
,
current
Propert
yIndex
,
current
Entr
yIndex
,
currentData
);
if
(
SUCCEEDED
(
hr
))
...
...
@@ -1115,79 +1115,79 @@ static HRESULT createDirEntry(
if
(
sizeOfNameString
==
0
)
{
/*
* The
property existi
s and is available, we found it.
* The
entry exist
s and is available, we found it.
*/
new
PropertyIndex
=
currentPropert
yIndex
;
new
EntryIndex
=
currentEntr
yIndex
;
}
}
else
{
/*
* We exhausted the
property list
, we will create more space below
* We exhausted the
directory entries
, we will create more space below
*/
new
PropertyIndex
=
currentPropert
yIndex
;
new
EntryIndex
=
currentEntr
yIndex
;
}
current
Propert
yIndex
++
;
current
Entr
yIndex
++
;
}
while
(
new
Propert
yIndex
==
DIRENTRY_NULL
);
}
while
(
new
Entr
yIndex
==
DIRENTRY_NULL
);
/*
* grow the
property chain
* grow the
directory stream
*/
if
(
FAILED
(
hr
))
{
BYTE
emptyData
[
RAW_DIRENTRY_SIZE
];
ULARGE_INTEGER
newSize
;
ULONG
propert
yIndex
;
ULONG
last
Property
=
0
;
ULONG
entr
yIndex
;
ULONG
last
Entry
=
0
;
ULONG
blockCount
=
0
;
/*
* obtain the new count of
property blocks
* obtain the new count of
blocks in the directory stream
*/
blockCount
=
BlockChainStream_GetCount
(
storage
->
rootBlockChain
)
+
1
;
/*
* initialize the size used by the
propert
y stream
* initialize the size used by the
director
y stream
*/
newSize
.
u
.
HighPart
=
0
;
newSize
.
u
.
LowPart
=
storage
->
bigBlockSize
*
blockCount
;
/*
* add a
property block to the property chain
* add a
block to the directory stream
*/
BlockChainStream_SetSize
(
storage
->
rootBlockChain
,
newSize
);
/*
* memset the empty
propert
y in order to initialize the unused newly
* created
property
* memset the empty
entr
y in order to initialize the unused newly
* created
entries
*/
memset
(
&
emptyData
,
0
,
RAW_DIRENTRY_SIZE
);
/*
* initialize them
*/
last
Propert
y
=
storage
->
bigBlockSize
/
RAW_DIRENTRY_SIZE
*
blockCount
;
last
Entr
y
=
storage
->
bigBlockSize
/
RAW_DIRENTRY_SIZE
*
blockCount
;
for
(
propertyIndex
=
newPropert
yIndex
+
1
;
propertyIndex
<
lastPropert
y
;
propert
yIndex
++
)
entryIndex
=
newEntr
yIndex
+
1
;
entryIndex
<
lastEntr
y
;
entr
yIndex
++
)
{
StorageImpl_WriteRawDirEntry
(
storage
,
propert
yIndex
,
entr
yIndex
,
emptyData
);
}
}
UpdateRawDirEntry
(
currentData
,
newData
);
hr
=
StorageImpl_WriteRawDirEntry
(
storage
,
new
Propert
yIndex
,
currentData
);
hr
=
StorageImpl_WriteRawDirEntry
(
storage
,
new
Entr
yIndex
,
currentData
);
if
(
SUCCEEDED
(
hr
))
*
index
=
new
Propert
yIndex
;
*
index
=
new
Entr
yIndex
;
return
hr
;
}
...
...
@@ -1245,7 +1245,7 @@ static LONG entryNameCmp(
*
* Internal Method
*
*
Properly link this new element in the property chain.
*
Add a directory entry to a storage
*/
static
HRESULT
insertIntoTree
(
StorageImpl
*
This
,
...
...
@@ -1256,14 +1256,14 @@ static HRESULT insertIntoTree(
DirEntry
newEntry
;
/*
* Read the inserted
propert
y
* Read the inserted
entr
y
*/
StorageImpl_ReadDirEntry
(
This
,
newEntryIndex
,
&
newEntry
);
/*
* Read the
root propert
y
* Read the
storage entr
y
*/
StorageImpl_ReadDirEntry
(
This
,
parentStorageIndex
,
...
...
@@ -1279,7 +1279,7 @@ static HRESULT insertIntoTree(
ULONG
current
,
next
,
previous
,
currentEntryId
;
/*
* Keep
the DirEntry sequence number of the storage first property
* Keep
a reference to the root of the storage's element tree
*/
currentEntryId
=
currentEntry
.
dirRootEntry
;
...
...
@@ -1350,7 +1350,7 @@ static HRESULT insertIntoTree(
else
{
/*
* The
root storage is empty, link the new property to its dir property
* The
storage is empty, make the new entry the root of its element tree
*/
currentEntry
.
dirRootEntry
=
newEntryIndex
;
StorageImpl_WriteDirEntry
(
This
,
...
...
@@ -1944,18 +1944,18 @@ static HRESULT deleteStreamContents(
return
S_OK
;
}
static
void
set
PropertyLink
(
DirEntry
*
propert
y
,
ULONG
relation
,
ULONG
new_target
)
static
void
set
EntryLink
(
DirEntry
*
entr
y
,
ULONG
relation
,
ULONG
new_target
)
{
switch
(
relation
)
{
case
DIRENTRY_RELATION_PREVIOUS
:
propert
y
->
leftChild
=
new_target
;
entr
y
->
leftChild
=
new_target
;
break
;
case
DIRENTRY_RELATION_NEXT
:
propert
y
->
rightChild
=
new_target
;
entr
y
->
rightChild
=
new_target
;
break
;
case
DIRENTRY_RELATION_DIR
:
propert
y
->
dirRootEntry
=
new_target
;
entr
y
->
dirRootEntry
=
new_target
;
break
;
default:
assert
(
0
);
...
...
@@ -1976,69 +1976,69 @@ static HRESULT removeFromTree(
{
HRESULT
hr
=
S_OK
;
BOOL
res
=
TRUE
;
DirEntry
propert
yToDelete
;
DirEntry
parent
Propert
y
;
ULONG
parent
PropertyId
;
DirEntry
entr
yToDelete
;
DirEntry
parent
Entr
y
;
ULONG
parent
EntryRef
;
ULONG
typeOfRelation
;
res
=
StorageImpl_ReadDirEntry
(
This
,
deletedIndex
,
&
propert
yToDelete
);
res
=
StorageImpl_ReadDirEntry
(
This
,
deletedIndex
,
&
entr
yToDelete
);
/*
* Find the
property
that links to the one we want to delete.
* Find the
element
that links to the one we want to delete.
*/
hr
=
findTreeParent
(
This
,
parentStorageIndex
,
propert
yToDelete
.
name
,
&
parent
Property
,
&
parentPropertyId
,
&
typeOfRelation
);
hr
=
findTreeParent
(
This
,
parentStorageIndex
,
entr
yToDelete
.
name
,
&
parent
Entry
,
&
parentEntryRef
,
&
typeOfRelation
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
propert
yToDelete
.
leftChild
!=
DIRENTRY_NULL
)
if
(
entr
yToDelete
.
leftChild
!=
DIRENTRY_NULL
)
{
/*
* Replace the deleted entry with its left child
*/
set
PropertyLink
(
&
parentProperty
,
typeOfRelation
,
propert
yToDelete
.
leftChild
);
set
EntryLink
(
&
parentEntry
,
typeOfRelation
,
entr
yToDelete
.
leftChild
);
res
=
StorageImpl_WriteDirEntry
(
This
,
parent
PropertyId
,
&
parent
Propert
y
);
parent
EntryRef
,
&
parent
Entr
y
);
if
(
!
res
)
{
return
E_FAIL
;
}
if
(
propert
yToDelete
.
rightChild
!=
DIRENTRY_NULL
)
if
(
entr
yToDelete
.
rightChild
!=
DIRENTRY_NULL
)
{
/*
* We need to reinsert the right child somewhere. We already know it and
* its children are greater than everything in the left tree, so we
* insert it at the rightmost point in the left tree.
*/
ULONG
newRightChildParent
=
propert
yToDelete
.
leftChild
;
DirEntry
newRightChildParent
Propert
y
;
ULONG
newRightChildParent
=
entr
yToDelete
.
leftChild
;
DirEntry
newRightChildParent
Entr
y
;
do
{
res
=
StorageImpl_ReadDirEntry
(
This
,
newRightChildParent
,
&
newRightChildParent
Propert
y
);
&
newRightChildParent
Entr
y
);
if
(
!
res
)
{
return
E_FAIL
;
}
if
(
newRightChildParent
Propert
y
.
rightChild
!=
DIRENTRY_NULL
)
newRightChildParent
=
newRightChildParent
Propert
y
.
rightChild
;
}
while
(
newRightChildParent
Propert
y
.
rightChild
!=
DIRENTRY_NULL
);
if
(
newRightChildParent
Entr
y
.
rightChild
!=
DIRENTRY_NULL
)
newRightChildParent
=
newRightChildParent
Entr
y
.
rightChild
;
}
while
(
newRightChildParent
Entr
y
.
rightChild
!=
DIRENTRY_NULL
);
newRightChildParent
Property
.
rightChild
=
propert
yToDelete
.
rightChild
;
newRightChildParent
Entry
.
rightChild
=
entr
yToDelete
.
rightChild
;
res
=
StorageImpl_WriteDirEntry
(
This
,
newRightChildParent
,
&
newRightChildParent
Propert
y
);
&
newRightChildParent
Entr
y
);
if
(
!
res
)
{
return
E_FAIL
;
...
...
@@ -2050,12 +2050,12 @@ static HRESULT removeFromTree(
/*
* Replace the deleted entry with its right child
*/
set
PropertyLink
(
&
parentProperty
,
typeOfRelation
,
propert
yToDelete
.
rightChild
);
set
EntryLink
(
&
parentEntry
,
typeOfRelation
,
entr
yToDelete
.
rightChild
);
res
=
StorageImpl_WriteDirEntry
(
This
,
parent
PropertyId
,
&
parent
Propert
y
);
parent
EntryRef
,
&
parent
Entr
y
);
if
(
!
res
)
{
return
E_FAIL
;
...
...
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