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
18988663
Commit
18988663
authored
Nov 19, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use more specific error codes than E_FAIL, where possible.
- Move vtable to end, give it the const modifier, and remove unneeded function declarations.
parent
2515ff77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
37 deletions
+25
-37
memorystream.c
dlls/shell32/memorystream.c
+25
-37
No files found.
dlls/shell32/memorystream.c
View file @
18988663
...
...
@@ -42,42 +42,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
shell
);
static
HRESULT
WINAPI
IStream_fnQueryInterface
(
IStream
*
iface
,
REFIID
riid
,
LPVOID
*
ppvObj
);
static
ULONG
WINAPI
IStream_fnAddRef
(
IStream
*
iface
);
static
ULONG
WINAPI
IStream_fnRelease
(
IStream
*
iface
);
static
HRESULT
WINAPI
IStream_fnRead
(
IStream
*
iface
,
void
*
pv
,
ULONG
cb
,
ULONG
*
pcbRead
);
static
HRESULT
WINAPI
IStream_fnWrite
(
IStream
*
iface
,
const
void
*
pv
,
ULONG
cb
,
ULONG
*
pcbWritten
);
static
HRESULT
WINAPI
IStream_fnSeek
(
IStream
*
iface
,
LARGE_INTEGER
dlibMove
,
DWORD
dwOrigin
,
ULARGE_INTEGER
*
plibNewPosition
);
static
HRESULT
WINAPI
IStream_fnSetSize
(
IStream
*
iface
,
ULARGE_INTEGER
libNewSize
);
static
HRESULT
WINAPI
IStream_fnCopyTo
(
IStream
*
iface
,
IStream
*
pstm
,
ULARGE_INTEGER
cb
,
ULARGE_INTEGER
*
pcbRead
,
ULARGE_INTEGER
*
pcbWritten
);
static
HRESULT
WINAPI
IStream_fnCommit
(
IStream
*
iface
,
DWORD
grfCommitFlags
);
static
HRESULT
WINAPI
IStream_fnRevert
(
IStream
*
iface
);
static
HRESULT
WINAPI
IStream_fnLockRegion
(
IStream
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
,
DWORD
dwLockType
);
static
HRESULT
WINAPI
IStream_fnUnlockRegion
(
IStream
*
iface
,
ULARGE_INTEGER
libOffset
,
ULARGE_INTEGER
cb
,
DWORD
dwLockType
);
static
HRESULT
WINAPI
IStream_fnStat
(
IStream
*
iface
,
STATSTG
*
pstatstg
,
DWORD
grfStatFlag
);
static
HRESULT
WINAPI
IStream_fnClone
(
IStream
*
iface
,
IStream
**
ppstm
);
static
IStreamVtbl
stvt
=
{
IStream_fnQueryInterface
,
IStream_fnAddRef
,
IStream_fnRelease
,
IStream_fnRead
,
IStream_fnWrite
,
IStream_fnSeek
,
IStream_fnSetSize
,
IStream_fnCopyTo
,
IStream_fnCommit
,
IStream_fnRevert
,
IStream_fnLockRegion
,
IStream_fnUnlockRegion
,
IStream_fnStat
,
IStream_fnClone
};
static
const
IStreamVtbl
stvt
;
typedef
struct
{
IStreamVtbl
*
lpvtst
;
{
const
IStreamVtbl
*
lpvtst
;
DWORD
ref
;
HANDLE
handle
;
}
ISHFileStream
;
...
...
@@ -110,12 +79,12 @@ HRESULT CreateStreamOnFile (LPCWSTR pszFilename, DWORD grfMode, IStream ** ppstm
handle
=
CreateFileW
(
pszFilename
,
access
,
FILE_SHARE_READ
,
NULL
,
creat
,
0
,
NULL
);
if
(
handle
==
INVALID_HANDLE_VALUE
)
return
E_FAIL
;
return
HRESULT_FROM_WIN32
(
GetLastError
())
;
fstr
=
(
ISHFileStream
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ISHFileStream
));
if
(
!
fstr
)
return
E_
FAIL
;
return
E_
OUTOFMEMORY
;
fstr
->
lpvtst
=&
stvt
;
fstr
->
ref
=
1
;
fstr
->
handle
=
handle
;
...
...
@@ -192,7 +161,7 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG
return
STG_E_INVALIDPOINTER
;
if
(
!
ReadFile
(
This
->
handle
,
pv
,
cb
,
pcbRead
,
NULL
)
)
return
E_FAIL
;
return
S_FALSE
;
return
S_OK
;
}
...
...
@@ -306,3 +275,22 @@ static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
return
E_NOTIMPL
;
}
static
const
IStreamVtbl
stvt
=
{
IStream_fnQueryInterface
,
IStream_fnAddRef
,
IStream_fnRelease
,
IStream_fnRead
,
IStream_fnWrite
,
IStream_fnSeek
,
IStream_fnSetSize
,
IStream_fnCopyTo
,
IStream_fnCommit
,
IStream_fnRevert
,
IStream_fnLockRegion
,
IStream_fnUnlockRegion
,
IStream_fnStat
,
IStream_fnClone
};
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