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
f8dd85f2
Commit
f8dd85f2
authored
Sep 16, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
propsys: Added InitVariantFromBuffer implementation.
parent
97b49079
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
propsys.spec
dlls/propsys/propsys.spec
+2
-2
propvar.c
dlls/propsys/propvar.c
+45
-0
No files found.
dlls/propsys/propsys.spec
View file @
f8dd85f2
...
...
@@ -28,7 +28,7 @@
@ stub DllRegisterServer
@ stub DllUnregisterServer
@ stub InitPropVariantFromBooleanVector
@ st
ub InitPropVariantFromBuffer
@ st
dcall InitPropVariantFromBuffer(ptr long ptr)
@ stub InitPropVariantFromCLSID
@ stub InitPropVariantFromDoubleVector
@ stub InitPropVariantFromFileTime
...
...
@@ -47,7 +47,7 @@
@ stub InitPropVariantFromUInt64Vector
@ stub InitPropVariantVectorFromPropVariant
@ stub InitVariantFromBooleanArray
@ st
ub InitVariantFromBuffer
@ st
dcall InitVariantFromBuffer(ptr long ptr)
@ stub InitVariantFromDoubleArray
@ stub InitVariantFromFileTime
@ stub InitVariantFromFileTimeArray
...
...
dlls/propsys/propvar.c
View file @
f8dd85f2
...
...
@@ -132,3 +132,48 @@ HRESULT WINAPI InitVariantFromGUIDAsString(REFGUID guid, VARIANT *pvar)
PROPVAR_GUIDToWSTR
(
guid
,
V_BSTR
(
pvar
));
return
S_OK
;
}
HRESULT
WINAPI
InitPropVariantFromBuffer
(
const
VOID
*
pv
,
UINT
cb
,
PROPVARIANT
*
ppropvar
)
{
TRACE
(
"(%p %u %p)
\n
"
,
pv
,
cb
,
ppropvar
);
ppropvar
->
u
.
caub
.
pElems
=
CoTaskMemAlloc
(
cb
);
if
(
!
ppropvar
->
u
.
caub
.
pElems
)
return
E_OUTOFMEMORY
;
ppropvar
->
vt
=
VT_VECTOR
|
VT_UI1
;
ppropvar
->
u
.
caub
.
cElems
=
cb
;
memcpy
(
ppropvar
->
u
.
caub
.
pElems
,
pv
,
cb
);
return
S_OK
;
}
HRESULT
WINAPI
InitVariantFromBuffer
(
const
VOID
*
pv
,
UINT
cb
,
VARIANT
*
pvar
)
{
SAFEARRAY
*
arr
;
void
*
data
;
HRESULT
hres
;
TRACE
(
"(%p %u %p)
\n
"
,
pv
,
cb
,
pvar
);
arr
=
SafeArrayCreateVector
(
VT_UI1
,
0
,
cb
);
if
(
!
arr
)
return
E_OUTOFMEMORY
;
hres
=
SafeArrayAccessData
(
arr
,
&
data
);
if
(
FAILED
(
hres
))
{
SafeArrayDestroy
(
arr
);
return
hres
;
}
memcpy
(
data
,
pv
,
cb
);
hres
=
SafeArrayUnaccessData
(
arr
);
if
(
FAILED
(
hres
))
{
SafeArrayDestroy
(
arr
);
return
hres
;
}
V_VT
(
pvar
)
=
VT_ARRAY
|
VT_UI1
;
V_ARRAY
(
pvar
)
=
arr
;
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