Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
d25450c8
Commit
d25450c8
authored
Sep 06, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemprox: Implement IWbemClassObject::SpawnInstance.
parent
e2bd61b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
7 deletions
+69
-7
class.c
dlls/wbemprox/class.c
+51
-5
services.c
dlls/wbemprox/services.c
+1
-1
wbemprox_private.h
dlls/wbemprox/wbemprox_private.h
+17
-1
No files found.
dlls/wbemprox/class.c
View file @
d25450c8
...
...
@@ -125,7 +125,7 @@ static HRESULT WINAPI enum_class_object_Next(
*
puReturned
=
0
;
if
(
ec
->
index
+
uCount
>
view
->
count
)
return
WBEM_S_FALSE
;
hr
=
create_class_object
(
view
->
table
->
name
,
iface
,
ec
->
index
,
apObjects
);
hr
=
create_class_object
(
view
->
table
->
name
,
iface
,
ec
->
index
,
NULL
,
apObjects
);
if
(
hr
!=
S_OK
)
return
hr
;
ec
->
index
++
;
...
...
@@ -212,6 +212,40 @@ HRESULT EnumWbemClassObject_create(
return
S_OK
;
}
static
struct
record
*
create_record
(
const
struct
column
*
columns
,
UINT
num_cols
)
{
UINT
i
;
struct
record
*
record
;
if
(
!
(
record
=
heap_alloc
(
sizeof
(
struct
record
)
)))
return
NULL
;
if
(
!
(
record
->
fields
=
heap_alloc
(
num_cols
*
sizeof
(
struct
field
)
)))
{
heap_free
(
record
);
return
NULL
;
}
for
(
i
=
0
;
i
<
num_cols
;
i
++
)
{
record
->
fields
[
i
].
type
=
columns
[
i
].
type
;
record
->
fields
[
i
].
u
.
ival
=
0
;
}
record
->
count
=
num_cols
;
return
record
;
}
static
void
destroy_record
(
struct
record
*
record
)
{
UINT
i
;
if
(
!
record
)
return
;
for
(
i
=
0
;
i
<
record
->
count
;
i
++
)
{
if
(
record
->
fields
[
i
].
type
==
CIM_STRING
||
record
->
fields
[
i
].
type
==
CIM_DATETIME
)
heap_free
(
record
->
fields
[
i
].
u
.
sval
);
}
heap_free
(
record
->
fields
);
heap_free
(
record
);
}
struct
class_object
{
IWbemClassObject
IWbemClassObject_iface
;
...
...
@@ -221,6 +255,7 @@ struct class_object
UINT
index
;
UINT
index_method
;
UINT
index_property
;
struct
record
*
record
;
/* uncommitted instance */
};
static
inline
struct
class_object
*
impl_from_IWbemClassObject
(
...
...
@@ -245,6 +280,7 @@ static ULONG WINAPI class_object_Release(
{
TRACE
(
"destroying %p
\n
"
,
co
);
if
(
co
->
iter
)
IEnumWbemClassObject_Release
(
co
->
iter
);
destroy_record
(
co
->
record
);
heap_free
(
co
->
name
);
heap_free
(
co
);
}
...
...
@@ -495,8 +531,17 @@ static HRESULT WINAPI class_object_SpawnInstance(
LONG
lFlags
,
IWbemClassObject
**
ppNewInstance
)
{
FIXME
(
"%p, %08x, %p
\n
"
,
iface
,
lFlags
,
ppNewInstance
);
return
E_NOTIMPL
;
struct
class_object
*
co
=
impl_from_IWbemClassObject
(
iface
);
struct
enum_class_object
*
ec
=
impl_from_IEnumWbemClassObject
(
co
->
iter
);
struct
view
*
view
=
ec
->
query
->
view
;
struct
record
*
record
;
TRACE
(
"%p, %08x, %p
\n
"
,
iface
,
lFlags
,
ppNewInstance
);
if
(
!
(
record
=
create_record
(
view
->
table
->
columns
,
view
->
table
->
num_cols
)))
return
E_OUTOFMEMORY
;
return
create_class_object
(
co
->
name
,
NULL
,
0
,
record
,
ppNewInstance
);
}
static
HRESULT
WINAPI
class_object_CompareTo
(
...
...
@@ -833,8 +878,8 @@ static const IWbemClassObjectVtbl class_object_vtbl =
class_object_GetMethodOrigin
};
HRESULT
create_class_object
(
const
WCHAR
*
name
,
IEnumWbemClassObject
*
iter
,
UINT
index
,
IWbemClassObject
**
obj
)
HRESULT
create_class_object
(
const
WCHAR
*
name
,
IEnumWbemClassObject
*
iter
,
UINT
index
,
struct
record
*
record
,
IWbemClassObject
**
obj
)
{
struct
class_object
*
co
;
...
...
@@ -855,6 +900,7 @@ HRESULT create_class_object(
co
->
index
=
index
;
co
->
index_method
=
0
;
co
->
index_property
=
0
;
co
->
record
=
record
;
if
(
iter
)
IEnumWbemClassObject_AddRef
(
iter
);
*
obj
=
&
co
->
IWbemClassObject_iface
;
...
...
dlls/wbemprox/services.c
View file @
d25450c8
...
...
@@ -334,7 +334,7 @@ HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
free_path
(
path
);
return
hr
;
}
hr
=
create_class_object
(
path
->
class
,
iter
,
0
,
obj
);
hr
=
create_class_object
(
path
->
class
,
iter
,
0
,
NULL
,
obj
);
IEnumWbemClassObject_Release
(
iter
);
free_path
(
path
);
return
hr
;
...
...
dlls/wbemprox/wbemprox_private.h
View file @
d25450c8
...
...
@@ -66,6 +66,22 @@ struct property
const
struct
property
*
next
;
};
struct
field
{
UINT
type
;
union
{
LONGLONG
ival
;
WCHAR
*
sval
;
}
u
;
};
struct
record
{
UINT
count
;
struct
field
*
fields
;
};
enum
operator
{
OP_EQ
=
1
,
...
...
@@ -157,7 +173,7 @@ const WCHAR *get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
HRESULT
WbemLocator_create
(
IUnknown
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
WbemServices_create
(
IUnknown
*
,
const
WCHAR
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
HRESULT
create_class_object
(
const
WCHAR
*
,
IEnumWbemClassObject
*
,
UINT
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
struct
record
*
,
IWbemClassObject
**
)
DECLSPEC_HIDDEN
;
HRESULT
EnumWbemClassObject_create
(
IUnknown
*
,
struct
query
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
static
void
*
heap_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
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