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
33817372
Commit
33817372
authored
Jul 01, 2002
by
Juergen Schmied
Committed by
Alexandre Julliard
Jul 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for large and negative offsets.
parent
4227bf4a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
38 deletions
+15
-38
hglobalstream.c
dlls/ole32/hglobalstream.c
+10
-33
ifs.c
dlls/ole32/ifs.c
+5
-5
No files found.
dlls/ole32/hglobalstream.c
View file @
33817372
...
...
@@ -33,6 +33,7 @@
#include "ole2.h"
#include "winbase.h"
#include "winerror.h"
#include "ntddk.h"
#include "wine/debug.h"
...
...
@@ -573,59 +574,35 @@ HRESULT WINAPI HGLOBALStreamImpl_Seek(
dlibMove
.
s
.
LowPart
,
dwOrigin
,
plibNewPosition
);
/*
* The caller is allowed to pass in NULL as the new position return value.
* If it happens, we assign it to a dynamic variable to avoid special cases
* in the code below.
*/
if
(
plibNewPosition
==
0
)
{
plibNewPosition
=
&
newPosition
;
}
/*
* The file pointer is moved depending on the given "function"
* parameter.
*/
switch
(
dwOrigin
)
{
case
STREAM_SEEK_SET
:
plibNewPosition
->
s
.
HighPart
=
0
;
plibNewPosition
->
s
.
LowPart
=
0
;
newPosition
.
s
.
HighPart
=
0
;
newPosition
.
s
.
LowPart
=
0
;
break
;
case
STREAM_SEEK_CUR
:
*
plibN
ewPosition
=
This
->
currentPosition
;
n
ewPosition
=
This
->
currentPosition
;
break
;
case
STREAM_SEEK_END
:
*
plibN
ewPosition
=
This
->
streamSize
;
n
ewPosition
=
This
->
streamSize
;
break
;
default:
return
STG_E_INVALIDFUNCTION
;
}
/*
* We don't support files with offsets of 64 bits.
*/
assert
(
dlibMove
.
s
.
HighPart
==
0
);
/*
* Check if we end-up before the beginning of the file. That should trigger an
* error.
*/
if
(
(
dlibMove
.
s
.
LowPart
<
0
)
&&
(
plibNewPosition
->
s
.
LowPart
<
(
ULONG
)(
-
dlibMove
.
s
.
LowPart
))
)
{
/*
* I don't know what error to send there.
*/
return
E_FAIL
;
}
/*
* Move the actual file pointer
* If the file pointer ends-up after the end of the stream, the next Write operation will
* make the file larger. This is how it is documented.
*/
plibNewPosition
->
s
.
LowPart
+=
dlibMove
.
s
.
LowPart
;
This
->
currentPosition
=
*
plibNewPosition
;
newPosition
.
QuadPart
=
RtlLargeIntegerAdd
(
newPosition
.
QuadPart
,
dlibMove
.
QuadPart
);
if
(
newPosition
.
QuadPart
<
0
)
return
STG_E_INVALIDFUNCTION
;
if
(
plibNewPosition
)
*
plibNewPosition
=
newPosition
;
This
->
currentPosition
=
newPosition
;
return
S_OK
;
}
...
...
dlls/ole32/ifs.c
View file @
33817372
...
...
@@ -260,14 +260,14 @@ typedef struct
static
HRESULT
WINAPI
IMalloc_fnQueryInterface
(
LPMALLOC
iface
,
REFIID
refiid
,
LPVOID
*
obj
)
{
ICOM_THIS
(
IMalloc32Impl
,
iface
);
TRACE
(
"(%p)->
QueryInterface
(%s,%p)
\n
"
,
This
,
debugstr_guid
(
refiid
),
obj
);
if
(
!
memcmp
(
&
IID_IUnknown
,
refiid
,
sizeof
(
IID_IUnknown
))
||
!
memcmp
(
&
IID_IMalloc
,
refiid
,
sizeof
(
IID_IMalloc
))
)
{
TRACE
(
"(%p)->(%s,%p)
\n
"
,
This
,
debugstr_guid
(
refiid
),
obj
);
if
(
IsEqualIID
(
&
IID_IUnknown
,
refiid
)
||
IsEqualIID
(
&
IID_IMalloc
,
refiid
)
)
{
*
obj
=
This
;
return
S_OK
;
}
return
OLE_E_ENUM_NOMOR
E
;
return
E_NOINTERFAC
E
;
}
/******************************************************************************
...
...
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