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
df5f835e
Commit
df5f835e
authored
Sep 03, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Use V_* macros to access variant data.
parent
b5cd4775
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
24 deletions
+24
-24
createdevenum.c
dlls/devenum/createdevenum.c
+5
-5
mediacatenum.c
dlls/devenum/mediacatenum.c
+18
-18
devenum.c
dlls/devenum/tests/devenum.c
+1
-1
No files found.
dlls/devenum/createdevenum.c
View file @
df5f835e
...
@@ -761,7 +761,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
...
@@ -761,7 +761,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
VARIANT
var
;
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_VT
(
&
var
)
=
VT_I4
;
V_
UNION
(
&
var
,
ulVal
)
=
i
;
V_
I4
(
&
var
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveOutID
,
&
var
);
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveOutID
,
&
var
);
...
@@ -769,7 +769,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
...
@@ -769,7 +769,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
pPropBag
=
NULL
;
pPropBag
=
NULL
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_
UNION
(
&
var
,
bstrVal
)
=
wocaps
.
szPname
;
V_
BSTR
(
&
var
)
=
wocaps
.
szPname
;
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
if
(
pPropBag
)
if
(
pPropBag
)
...
@@ -842,7 +842,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
...
@@ -842,7 +842,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
VARIANT
var
;
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_VT
(
&
var
)
=
VT_I4
;
V_
UNION
(
&
var
,
ulVal
)
=
i
;
V_
I4
(
&
var
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveInID
,
&
var
);
res
=
IPropertyBag_Write
(
pPropBag
,
wszWaveInID
,
&
var
);
...
@@ -850,7 +850,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
...
@@ -850,7 +850,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
pPropBag
=
NULL
;
pPropBag
=
NULL
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_VT
(
&
var
)
=
VT_LPWSTR
;
V_
UNION
(
&
var
,
bstrVal
)
=
wicaps
.
szPname
;
V_
BSTR
(
&
var
)
=
wicaps
.
szPname
;
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
res
=
IPropertyBag_Write
(
pPropBag
,
wszFriendlyName
,
&
var
);
...
@@ -952,7 +952,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
...
@@ -952,7 +952,7 @@ static HRESULT DEVENUM_CreateSpecialCategories(void)
OLECHAR
wszVfwIndex
[]
=
{
'V'
,
'F'
,
'W'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
OLECHAR
wszVfwIndex
[]
=
{
'V'
,
'F'
,
'W'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
VARIANT
var
;
VARIANT
var
;
V_VT
(
&
var
)
=
VT_I4
;
V_VT
(
&
var
)
=
VT_I4
;
V_
UNION
(
&
var
,
ulVal
)
=
i
;
V_
I4
(
&
var
)
=
i
;
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
res
=
IMoniker_BindToStorage
(
pMoniker
,
NULL
,
NULL
,
&
IID_IPropertyBag
,
(
LPVOID
)
&
pPropBag
);
if
(
SUCCEEDED
(
res
))
{
if
(
SUCCEEDED
(
res
))
{
res
=
IPropertyBag_Write
(
pPropBag
,
wszVfwIndex
,
&
var
);
res
=
IPropertyBag_Write
(
pPropBag
,
wszVfwIndex
,
&
var
);
...
...
dlls/devenum/mediacatenum.c
View file @
df5f835e
...
@@ -149,15 +149,15 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
...
@@ -149,15 +149,15 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
switch
(
V_VT
(
pVar
))
switch
(
V_VT
(
pVar
))
{
{
case
VT_LPWSTR
:
case
VT_LPWSTR
:
V_
UNION
(
pVar
,
bstrVal
)
=
CoTaskMemAlloc
(
received
);
V_
BSTR
(
pVar
)
=
CoTaskMemAlloc
(
received
);
memcpy
(
V_
UNION
(
pVar
,
bstrVal
),
pData
,
received
);
memcpy
(
V_
BSTR
(
pVar
),
pData
,
received
);
res
=
S_OK
;
res
=
S_OK
;
break
;
break
;
case
VT_EMPTY
:
case
VT_EMPTY
:
V_VT
(
pVar
)
=
VT_BSTR
;
V_VT
(
pVar
)
=
VT_BSTR
;
/* fall through */
/* fall through */
case
VT_BSTR
:
case
VT_BSTR
:
V_
UNION
(
pVar
,
bstrVal
)
=
SysAllocStringLen
(
pData
,
received
/
sizeof
(
WCHAR
)
-
1
);
V_
BSTR
(
pVar
)
=
SysAllocStringLen
(
pData
,
received
/
sizeof
(
WCHAR
)
-
1
);
res
=
S_OK
;
res
=
S_OK
;
break
;
break
;
}
}
...
@@ -171,7 +171,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
...
@@ -171,7 +171,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
/* fall through */
/* fall through */
case
VT_I4
:
case
VT_I4
:
case
VT_UI4
:
case
VT_UI4
:
V_
UNION
(
pVar
,
ulVal
)
=
*
(
DWORD
*
)
pData
;
V_
I4
(
pVar
)
=
*
(
DWORD
*
)
pData
;
res
=
S_OK
;
res
=
S_OK
;
break
;
break
;
}
}
...
@@ -189,7 +189,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
...
@@ -189,7 +189,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
V_VT
(
pVar
)
=
VT_ARRAY
|
VT_UI1
;
V_VT
(
pVar
)
=
VT_ARRAY
|
VT_UI1
;
/* fall through */
/* fall through */
case
VT_ARRAY
|
VT_UI1
:
case
VT_ARRAY
|
VT_UI1
:
if
(
!
(
V_
UNION
(
pVar
,
parray
)
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
bound
)))
if
(
!
(
V_
ARRAY
(
pVar
)
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
bound
)))
res
=
E_OUTOFMEMORY
;
res
=
E_OUTOFMEMORY
;
else
else
res
=
S_OK
;
res
=
S_OK
;
...
@@ -199,12 +199,12 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
...
@@ -199,12 +199,12 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
if
(
res
==
E_INVALIDARG
)
if
(
res
==
E_INVALIDARG
)
break
;
break
;
res
=
SafeArrayAccessData
(
V_
UNION
(
pVar
,
parray
),
&
pArrayElements
);
res
=
SafeArrayAccessData
(
V_
ARRAY
(
pVar
),
&
pArrayElements
);
if
(
FAILED
(
res
))
if
(
FAILED
(
res
))
break
;
break
;
CopyMemory
(
pArrayElements
,
pData
,
received
);
CopyMemory
(
pArrayElements
,
pData
,
received
);
res
=
SafeArrayUnaccessData
(
V_
UNION
(
pVar
,
parray
));
res
=
SafeArrayUnaccessData
(
V_
ARRAY
(
pVar
));
break
;
break
;
}
}
}
}
...
@@ -235,15 +235,15 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
...
@@ -235,15 +235,15 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
{
{
case
VT_BSTR
:
case
VT_BSTR
:
case
VT_LPWSTR
:
case
VT_LPWSTR
:
TRACE
(
"writing %s
\n
"
,
debugstr_w
(
V_
UNION
(
pVar
,
bstrVal
)));
TRACE
(
"writing %s
\n
"
,
debugstr_w
(
V_
BSTR
(
pVar
)));
lpData
=
V_
UNION
(
pVar
,
bstrVal
);
lpData
=
V_
BSTR
(
pVar
);
dwType
=
REG_SZ
;
dwType
=
REG_SZ
;
cbData
=
(
lstrlenW
(
V_
UNION
(
pVar
,
bstrVal
))
+
1
)
*
sizeof
(
WCHAR
);
cbData
=
(
lstrlenW
(
V_
BSTR
(
pVar
))
+
1
)
*
sizeof
(
WCHAR
);
break
;
break
;
case
VT_I4
:
case
VT_I4
:
case
VT_UI4
:
case
VT_UI4
:
TRACE
(
"writing %u
\n
"
,
V_U
NION
(
pVar
,
ulVal
));
TRACE
(
"writing %u
\n
"
,
V_U
I4
(
pVar
));
lpData
=
&
V_U
NION
(
pVar
,
ulVal
);
lpData
=
&
V_U
I4
(
pVar
);
dwType
=
REG_DWORD
;
dwType
=
REG_DWORD
;
cbData
=
sizeof
(
DWORD
);
cbData
=
sizeof
(
DWORD
);
break
;
break
;
...
@@ -252,11 +252,11 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
...
@@ -252,11 +252,11 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
LONG
lUbound
=
0
;
LONG
lUbound
=
0
;
LONG
lLbound
=
0
;
LONG
lLbound
=
0
;
dwType
=
REG_BINARY
;
dwType
=
REG_BINARY
;
res
=
SafeArrayGetLBound
(
V_
UNION
(
pVar
,
parray
),
1
,
&
lLbound
);
res
=
SafeArrayGetLBound
(
V_
ARRAY
(
pVar
),
1
,
&
lLbound
);
res
=
SafeArrayGetUBound
(
V_
UNION
(
pVar
,
parray
),
1
,
&
lUbound
);
res
=
SafeArrayGetUBound
(
V_
ARRAY
(
pVar
),
1
,
&
lUbound
);
cbData
=
(
lUbound
-
lLbound
+
1
)
/* * sizeof(BYTE)*/
;
cbData
=
(
lUbound
-
lLbound
+
1
)
/* * sizeof(BYTE)*/
;
TRACE
(
"cbData: %d
\n
"
,
cbData
);
TRACE
(
"cbData: %d
\n
"
,
cbData
);
res
=
SafeArrayAccessData
(
V_
UNION
(
pVar
,
parray
),
&
lpData
);
res
=
SafeArrayAccessData
(
V_
ARRAY
(
pVar
),
&
lpData
);
break
;
break
;
}
}
default:
default:
...
@@ -270,7 +270,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
...
@@ -270,7 +270,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Write(
res
=
E_FAIL
;
res
=
E_FAIL
;
if
(
V_VT
(
pVar
)
&
VT_ARRAY
)
if
(
V_VT
(
pVar
)
&
VT_ARRAY
)
res
=
SafeArrayUnaccessData
(
V_
UNION
(
pVar
,
parray
));
res
=
SafeArrayUnaccessData
(
V_
ARRAY
(
pVar
));
return
res
;
return
res
;
}
}
...
@@ -421,8 +421,8 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(IMoniker *iface, IBi
...
@@ -421,8 +421,8 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_BindToObject(IMoniker *iface, IBi
}
}
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
{
{
res
=
CLSIDFromString
(
V_
UNION
(
&
var
,
bstrVal
),
&
clsID
);
res
=
CLSIDFromString
(
V_
BSTR
(
&
var
),
&
clsID
);
CoTaskMemFree
(
V_
UNION
(
&
var
,
bstrVal
));
CoTaskMemFree
(
V_
BSTR
(
&
var
));
}
}
if
(
SUCCEEDED
(
res
))
if
(
SUCCEEDED
(
res
))
{
{
...
...
dlls/devenum/tests/devenum.c
View file @
df5f835e
...
@@ -92,7 +92,7 @@ static void test_devenum(IBindCtx *bind_ctx)
...
@@ -92,7 +92,7 @@ static void test_devenum(IBindCtx *bind_ctx)
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
if
(
winetest_debug
>
1
)
if
(
winetest_debug
>
1
)
trace
(
" %s
\n
"
,
wine_dbgstr_w
(
V_
UNION
(
&
var
,
bstrVal
)));
trace
(
" %s
\n
"
,
wine_dbgstr_w
(
V_
BSTR
(
&
var
)));
VariantClear
(
&
var
);
VariantClear
(
&
var
);
}
}
else
else
...
...
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