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
14f8f9d5
Commit
14f8f9d5
authored
Jul 17, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Jul 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Remove the BigBlockFile abstraction and always use an ILockBytes.
parent
41714994
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
44 deletions
+23
-44
Makefile.in
dlls/ole32/Makefile.in
+1
-1
filelockbytes.c
dlls/ole32/filelockbytes.c
+0
-0
storage32.c
dlls/ole32/storage32.c
+19
-14
storage32.h
dlls/ole32/storage32.h
+3
-29
No files found.
dlls/ole32/Makefile.in
View file @
14f8f9d5
...
...
@@ -21,6 +21,7 @@ C_SRCS = \
dictionary.c
\
enumx.c
\
errorinfo.c
\
filelockbytes.c
\
filemoniker.c
\
ftmarshal.c
\
git.c
\
...
...
@@ -39,7 +40,6 @@ C_SRCS = \
pointermoniker.c
\
regsvr.c
\
rpc.c
\
stg_bigblockfile.c
\
stg_prop.c
\
stg_stream.c
\
storage32.c
\
...
...
dlls/ole32/
stg_bigblockfile
.c
→
dlls/ole32/
filelockbytes
.c
View file @
14f8f9d5
This diff is collapsed.
Click to expand it.
dlls/ole32/storage32.c
View file @
14f8f9d5
...
...
@@ -327,7 +327,7 @@ static HRESULT StorageImpl_ReadAt(StorageImpl* This,
ULONG
size
,
ULONG
*
bytesRead
)
{
return
BIGBLOCKFILE_ReadAt
(
This
->
bigBlockFile
,
offset
,
buffer
,
size
,
bytesRead
);
return
ILockBytes_ReadAt
(
This
->
lockBytes
,
offset
,
buffer
,
size
,
bytesRead
);
}
static
HRESULT
StorageImpl_WriteAt
(
StorageImpl
*
This
,
...
...
@@ -336,7 +336,7 @@ static HRESULT StorageImpl_WriteAt(StorageImpl* This,
const
ULONG
size
,
ULONG
*
bytesWritten
)
{
return
BIGBLOCKFILE_WriteAt
(
This
->
bigBlockFile
,
offset
,
buffer
,
size
,
bytesWritten
);
return
ILockBytes_WriteAt
(
This
->
lockBytes
,
offset
,
buffer
,
size
,
bytesWritten
);
}
/************************************************************************
...
...
@@ -2683,17 +2683,17 @@ static HRESULT StorageImpl_Construct(
*/
This
->
bigBlockSize
=
sector_size
;
This
->
smallBlockSize
=
DEF_SMALL_BLOCK_SIZE
;
This
->
bigBlockFile
=
BIGBLOCKFILE_Construct
(
hFile
,
pLkbyt
,
openFlags
,
fileBased
);
if
(
This
->
bigBlockFile
==
0
)
if
(
hFile
)
hr
=
FileLockBytesImpl_Construct
(
hFile
,
openFlags
,
&
This
->
lockBytes
);
else
{
hr
=
E_FAIL
;
goto
end
;
This
->
lockBytes
=
pLkbyt
;
ILockBytes_AddRef
(
pLkbyt
)
;
}
if
(
FAILED
(
hr
))
goto
end
;
if
(
create
)
{
ULARGE_INTEGER
size
;
...
...
@@ -2729,7 +2729,7 @@ static HRESULT StorageImpl_Construct(
*/
size
.
u
.
HighPart
=
0
;
size
.
u
.
LowPart
=
This
->
bigBlockSize
*
3
;
BIGBLOCKFILE_SetSize
(
This
->
bigBlockFile
,
size
);
ILockBytes_SetSize
(
This
->
lockBytes
,
size
);
/*
* Initialize the big block depot
...
...
@@ -2884,8 +2884,8 @@ static void StorageImpl_Destroy(StorageBaseImpl* iface)
for
(
i
=
0
;
i
<
BLOCKCHAIN_CACHE_SIZE
;
i
++
)
BlockChainStream_Destroy
(
This
->
blockChainCache
[
i
]);
if
(
This
->
bigBlockFile
)
BIGBLOCKFILE_Destructor
(
This
->
bigBlockFile
);
if
(
This
->
lockBytes
)
ILockBytes_Release
(
This
->
lockBytes
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -2908,6 +2908,7 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
int
depotIndex
=
0
;
ULONG
freeBlock
=
BLOCK_UNUSED
;
ULARGE_INTEGER
neededSize
;
STATSTG
statstg
;
depotIndex
=
This
->
prevFreeBlock
/
blocksPerDepot
;
depotBlockOffset
=
(
This
->
prevFreeBlock
%
blocksPerDepot
)
*
sizeof
(
ULONG
);
...
...
@@ -3022,7 +3023,11 @@ static ULONG StorageImpl_GetNextFreeBigBlock(
* make sure that the block physically exists before using it
*/
neededSize
.
QuadPart
=
StorageImpl_GetBigBlockOffset
(
This
,
freeBlock
)
+
This
->
bigBlockSize
;
BIGBLOCKFILE_Expand
(
This
->
bigBlockFile
,
neededSize
);
ILockBytes_Stat
(
This
->
lockBytes
,
&
statstg
,
STATFLAG_NONAME
);
if
(
neededSize
.
QuadPart
>
statstg
.
cbSize
.
QuadPart
)
ILockBytes_SetSize
(
This
->
lockBytes
,
neededSize
);
This
->
prevFreeBlock
=
freeBlock
;
...
...
dlls/ole32/storage32.h
View file @
14f8f9d5
...
...
@@ -11,6 +11,7 @@
*
* Copyright 1998,1999 Francis Beaudet
* Copyright 1998,1999 Thuy Nguyen
* Copyright 2010 Vincent Povirk for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -153,31 +154,7 @@ struct DirEntry
ULARGE_INTEGER
size
;
};
/*************************************************************************
* Big Block File support
*
* The big block file is an abstraction of a flat file separated in
* same sized blocks. The implementation for the methods described in
* this section appear in stg_bigblockfile.c
*/
typedef
struct
BigBlockFile
BigBlockFile
,
*
LPBIGBLOCKFILE
;
/*
* Declaration of the functions used to manipulate the BigBlockFile
* data structure.
*/
BigBlockFile
*
BIGBLOCKFILE_Construct
(
HANDLE
hFile
,
ILockBytes
*
pLkByt
,
DWORD
openFlags
,
BOOL
fileBased
);
void
BIGBLOCKFILE_Destructor
(
LPBIGBLOCKFILE
This
);
HRESULT
BIGBLOCKFILE_Expand
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_SetSize
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
newSize
);
HRESULT
BIGBLOCKFILE_ReadAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
void
*
buffer
,
ULONG
size
,
ULONG
*
bytesRead
);
HRESULT
BIGBLOCKFILE_WriteAt
(
LPBIGBLOCKFILE
This
,
ULARGE_INTEGER
offset
,
const
void
*
buffer
,
ULONG
size
,
ULONG
*
bytesRead
);
HRESULT
FileLockBytesImpl_Construct
(
HANDLE
hFile
,
DWORD
openFlags
,
ILockBytes
**
pLockBytes
);
/*************************************************************************
* Ole Convert support
...
...
@@ -395,10 +372,7 @@ struct StorageImpl
BlockChainStream
*
blockChainCache
[
BLOCKCHAIN_CACHE_SIZE
];
UINT
blockChainToEvict
;
/*
* Pointer to the big block file abstraction
*/
BigBlockFile
*
bigBlockFile
;
ILockBytes
*
lockBytes
;
};
HRESULT
StorageImpl_ReadRawDirEntry
(
...
...
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