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
8c331e33
Commit
8c331e33
authored
Feb 01, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Feb 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxdiagn: Convert the property linked list to a standard Wine list.
parent
a421adf0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
35 deletions
+27
-35
container.c
dlls/dxdiagn/container.c
+23
-31
dxdiag_private.h
dlls/dxdiagn/dxdiag_private.h
+4
-4
No files found.
dlls/dxdiagn/container.c
View file @
8c331e33
...
@@ -184,7 +184,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER ifa
...
@@ -184,7 +184,7 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetNumberOfProps(PDXDIAGCONTAINER ifa
static
HRESULT
WINAPI
IDxDiagContainerImpl_EnumPropNames
(
PDXDIAGCONTAINER
iface
,
DWORD
dwIndex
,
LPWSTR
pwszPropName
,
DWORD
cchPropName
)
{
static
HRESULT
WINAPI
IDxDiagContainerImpl_EnumPropNames
(
PDXDIAGCONTAINER
iface
,
DWORD
dwIndex
,
LPWSTR
pwszPropName
,
DWORD
cchPropName
)
{
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl_Property
*
p
=
NULL
;
IDxDiagContainerImpl_Property
*
p
;
DWORD
i
=
0
;
DWORD
i
=
0
;
TRACE
(
"(%p, %u, %p, %u)
\n
"
,
iface
,
dwIndex
,
pwszPropName
,
cchPropName
);
TRACE
(
"(%p, %u, %p, %u)
\n
"
,
iface
,
dwIndex
,
pwszPropName
,
cchPropName
);
...
@@ -193,24 +193,24 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface,
...
@@ -193,24 +193,24 @@ static HRESULT WINAPI IDxDiagContainerImpl_EnumPropNames(PDXDIAGCONTAINER iface,
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
p
=
This
->
properties
;
LIST_FOR_EACH_ENTRY
(
p
,
&
This
->
properties
,
IDxDiagContainerImpl_Property
,
entry
)
while
(
NULL
!=
p
)
{
{
if
(
dwIndex
==
i
)
{
if
(
dwIndex
==
i
)
{
TRACE
(
"Found property name %s, copying string
\n
"
,
debugstr_w
(
p
->
v
Name
));
TRACE
(
"Found property name %s, copying string
\n
"
,
debugstr_w
(
p
->
prop
Name
));
lstrcpynW
(
pwszPropName
,
p
->
v
Name
,
cchPropName
);
lstrcpynW
(
pwszPropName
,
p
->
prop
Name
,
cchPropName
);
return
(
cchPropName
<=
strlenW
(
p
->
v
Name
))
?
return
(
cchPropName
<=
strlenW
(
p
->
prop
Name
))
?
DXDIAG_E_INSUFFICIENT_BUFFER
:
S_OK
;
DXDIAG_E_INSUFFICIENT_BUFFER
:
S_OK
;
}
}
p
=
p
->
next
;
++
i
;
++
i
;
}
}
TRACE
(
"Failed to find property name at specified index
\n
"
);
TRACE
(
"Failed to find property name at specified index
\n
"
);
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
static
HRESULT
WINAPI
IDxDiagContainerImpl_GetProp
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszPropName
,
VARIANT
*
pvarProp
)
{
static
HRESULT
WINAPI
IDxDiagContainerImpl_GetProp
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszPropName
,
VARIANT
*
pvarProp
)
{
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl_Property
*
p
=
NULL
;
IDxDiagContainerImpl_Property
*
p
;
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_w
(
pwszPropName
),
pvarProp
);
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_w
(
pwszPropName
),
pvarProp
);
...
@@ -218,24 +218,23 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWS
...
@@ -218,24 +218,23 @@ static HRESULT WINAPI IDxDiagContainerImpl_GetProp(PDXDIAGCONTAINER iface, LPCWS
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
p
=
This
->
properties
;
LIST_FOR_EACH_ENTRY
(
p
,
&
This
->
properties
,
IDxDiagContainerImpl_Property
,
entry
)
while
(
NULL
!=
p
)
{
{
if
(
0
==
lstrcmpW
(
p
->
v
Name
,
pwszPropName
))
{
if
(
0
==
lstrcmpW
(
p
->
prop
Name
,
pwszPropName
))
{
HRESULT
hr
=
VariantClear
(
pvarProp
);
HRESULT
hr
=
VariantClear
(
pvarProp
);
if
(
hr
==
DISP_E_ARRAYISLOCKED
||
hr
==
DISP_E_BADVARTYPE
)
if
(
hr
==
DISP_E_ARRAYISLOCKED
||
hr
==
DISP_E_BADVARTYPE
)
VariantInit
(
pvarProp
);
VariantInit
(
pvarProp
);
return
VariantCopy
(
pvarProp
,
&
p
->
v
);
return
VariantCopy
(
pvarProp
,
&
p
->
v
Prop
);
}
}
p
=
p
->
next
;
}
}
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
HRESULT
WINAPI
IDxDiagContainerImpl_AddProp
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszPropName
,
VARIANT
*
pVarProp
)
{
HRESULT
WINAPI
IDxDiagContainerImpl_AddProp
(
PDXDIAGCONTAINER
iface
,
LPCWSTR
pwszPropName
,
VARIANT
*
pVarProp
)
{
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl
*
This
=
(
IDxDiagContainerImpl
*
)
iface
;
IDxDiagContainerImpl_Property
*
p
=
NULL
;
IDxDiagContainerImpl_Property
*
pNew
;
IDxDiagContainerImpl_Property
*
pNew
=
NULL
;
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_w
(
pwszPropName
),
pVarProp
);
TRACE
(
"(%p, %s, %p)
\n
"
,
iface
,
debugstr_w
(
pwszPropName
),
pVarProp
);
...
@@ -247,25 +246,17 @@ HRESULT WINAPI IDxDiagContainerImpl_AddProp(PDXDIAGCONTAINER iface, LPCWSTR pwsz
...
@@ -247,25 +246,17 @@ HRESULT WINAPI IDxDiagContainerImpl_AddProp(PDXDIAGCONTAINER iface, LPCWSTR pwsz
if
(
NULL
==
pNew
)
{
if
(
NULL
==
pNew
)
{
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
VariantInit
(
&
pNew
->
v
);
VariantCopy
(
&
pNew
->
v
,
pVarProp
);
pNew
->
propName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwszPropName
)
+
1
)
*
sizeof
(
WCHAR
));
pNew
->
vName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
pwszPropName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
NULL
==
pNew
->
propName
)
{
if
(
NULL
==
pNew
->
vName
)
{
HeapFree
(
GetProcessHeap
(),
0
,
pNew
);
HeapFree
(
GetProcessHeap
(),
0
,
pNew
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
lstrcpyW
(
pNew
->
vName
,
pwszPropName
);
lstrcpyW
(
pNew
->
propName
,
pwszPropName
);
pNew
->
next
=
NULL
;
VariantInit
(
&
pNew
->
vProp
);
VariantCopy
(
&
pNew
->
vProp
,
pVarProp
);
p
=
This
->
properties
;
if
(
NULL
==
p
)
{
list_add_tail
(
&
This
->
properties
,
&
pNew
->
entry
);
This
->
properties
=
pNew
;
}
else
{
while
(
NULL
!=
p
->
next
)
{
p
=
p
->
next
;
}
p
->
next
=
pNew
;
}
++
This
->
nProperties
;
++
This
->
nProperties
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -324,6 +315,7 @@ HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj) {
...
@@ -324,6 +315,7 @@ HRESULT DXDiag_CreateDXDiagContainer(REFIID riid, LPVOID *ppobj) {
}
}
container
->
lpVtbl
=
&
DxDiagContainer_Vtbl
;
container
->
lpVtbl
=
&
DxDiagContainer_Vtbl
;
container
->
ref
=
0
;
/* will be inited with QueryInterface */
container
->
ref
=
0
;
/* will be inited with QueryInterface */
list_init
(
&
container
->
properties
);
list_init
(
&
container
->
subContainers
);
list_init
(
&
container
->
subContainers
);
return
IDxDiagContainerImpl_QueryInterface
((
PDXDIAGCONTAINER
)
container
,
riid
,
ppobj
);
return
IDxDiagContainerImpl_QueryInterface
((
PDXDIAGCONTAINER
)
container
,
riid
,
ppobj
);
}
}
dlls/dxdiagn/dxdiag_private.h
View file @
8c331e33
...
@@ -62,9 +62,9 @@ typedef struct IDxDiagContainerImpl_SubContainer {
...
@@ -62,9 +62,9 @@ typedef struct IDxDiagContainerImpl_SubContainer {
}
IDxDiagContainerImpl_SubContainer
;
}
IDxDiagContainerImpl_SubContainer
;
typedef
struct
IDxDiagContainerImpl_Property
{
typedef
struct
IDxDiagContainerImpl_Property
{
LPWSTR
vName
;
struct
list
entry
;
VARIANT
v
;
WCHAR
*
propName
;
struct
IDxDiagContainerImpl_Property
*
next
;
VARIANT
vProp
;
}
IDxDiagContainerImpl_Property
;
}
IDxDiagContainerImpl_Property
;
...
@@ -76,7 +76,7 @@ struct IDxDiagContainerImpl {
...
@@ -76,7 +76,7 @@ struct IDxDiagContainerImpl {
const
IDxDiagContainerVtbl
*
lpVtbl
;
const
IDxDiagContainerVtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
/* IDxDiagContainer fields */
/* IDxDiagContainer fields */
IDxDiagContainerImpl_Property
*
properties
;
struct
list
properties
;
struct
list
subContainers
;
struct
list
subContainers
;
DWORD
nProperties
;
DWORD
nProperties
;
DWORD
nSubContainers
;
DWORD
nSubContainers
;
...
...
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