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
c1f37385
Commit
c1f37385
authored
Jul 05, 2002
by
Marcus Meissner
Committed by
Alexandre Julliard
Jul 05, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a generic way of doing GetHGlobalFromILockBytes().
parent
02ecbd19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
memlockbytes.c
dlls/ole32/memlockbytes.c
+29
-7
No files found.
dlls/ole32/memlockbytes.c
View file @
c1f37385
...
...
@@ -174,15 +174,38 @@ HRESULT WINAPI CreateILockBytesOnHGlobal(HGLOBAL hGlobal,
HRESULT
WINAPI
GetHGlobalFromILockBytes
(
ILockBytes
*
plkbyt
,
HGLOBAL
*
phglobal
)
{
HGLOBALLockBytesImpl
*
const
pMemLockBytes
=
(
HGLOBALLockBytesImpl
*
)
plkbyt
;
STATSTG
stbuf
;
HRESULT
hres
;
ULARGE_INTEGER
start
;
ULONG
xread
;
if
(
ICOM_VTBL
(
pMemLockBytes
)
==
&
HGLOBALLockBytesImpl_Vtbl
)
*
phglobal
=
0
;
if
(
ICOM_VTBL
(
pMemLockBytes
)
==
&
HGLOBALLockBytesImpl_Vtbl
)
{
*
phglobal
=
pMemLockBytes
->
supportHandle
;
else
*
phglobal
=
0
;
if
(
*
phglobal
==
0
)
if
(
*
phglobal
==
0
)
return
E_INVALIDARG
;
return
S_OK
;
}
/* It is not our lockbytes implementation, so use a more generic way */
hres
=
ILockBytes_Stat
(
plkbyt
,
&
stbuf
,
0
);
if
(
hres
!=
S_OK
)
{
ERR
(
"Cannot ILockBytes_Stat, %lx
\n
"
,
hres
);
return
hres
;
}
FIXME
(
"cbSize is %ld
\n
"
,
stbuf
.
cbSize
.
s
.
LowPart
);
*
phglobal
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_SHARE
,
stbuf
.
cbSize
.
s
.
LowPart
);
if
(
!*
phglobal
)
return
E_INVALIDARG
;
memset
(
&
start
,
0
,
sizeof
(
start
));
hres
=
ILockBytes_ReadAt
(
plkbyt
,
start
,
GlobalLock
(
*
phglobal
),
stbuf
.
cbSize
.
s
.
LowPart
,
&
xread
);
GlobalUnlock
(
*
phglobal
);
if
(
hres
!=
S_OK
)
{
FIXME
(
"%p->ReadAt failed with %lx
\n
"
,
plkbyt
,
hres
);
return
hres
;
}
if
(
stbuf
.
cbSize
.
s
.
LowPart
!=
xread
)
{
FIXME
(
"Read size is not requested size %ld vs %ld?
\n
"
,
stbuf
.
cbSize
.
s
.
LowPart
,
xread
);
}
return
S_OK
;
}
...
...
@@ -594,4 +617,3 @@ HRESULT WINAPI HGLOBALLockBytesImpl_Stat(
return
S_OK
;
}
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