Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
ec1a57f2
Commit
ec1a57f2
authored
11 years ago
by
Hans Leidekker
Committed by
Alexandre Julliard
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wbemprox: Add a partial implementation of Win32_NetworkAdapterConfiguration.
parent
1eefe9dd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wbemprox/builtin.c
+63
-0
63 additions, 0 deletions
dlls/wbemprox/builtin.c
with
63 additions
and
0 deletions
dlls/wbemprox/builtin.c
+
63
−
0
View file @
ec1a57f2
...
...
@@ -66,6 +66,9 @@ static const WCHAR class_logicaldisk2W[] =
{
'C'
,
'I'
,
'M'
,
'_'
,
'L'
,
'o'
,
'g'
,
'i'
,
'c'
,
'a'
,
'l'
,
'D'
,
'i'
,
's'
,
'k'
,
0
};
static
const
WCHAR
class_networkadapterW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'N'
,
'e'
,
't'
,
'w'
,
'o'
,
'r'
,
'k'
,
'A'
,
'd'
,
'a'
,
'p'
,
't'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
class_networkadapterconfigW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'N'
,
'e'
,
't'
,
'w'
,
'o'
,
'r'
,
'k'
,
'A'
,
'd'
,
'a'
,
'p'
,
't'
,
'e'
,
'r'
,
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'u'
,
'r'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
class_osW
[]
=
{
'W'
,
'i'
,
'n'
,
'3'
,
'2'
,
'_'
,
'O'
,
'p'
,
'e'
,
'r'
,
'a'
,
't'
,
'i'
,
'n'
,
'g'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
0
};
static
const
WCHAR
class_paramsW
[]
=
...
...
@@ -160,6 +163,8 @@ static const WCHAR prop_interfaceindexW[] =
{
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'f'
,
'a'
,
'c'
,
'e'
,
'I'
,
'n'
,
'd'
,
'e'
,
'x'
,
0
};
static
const
WCHAR
prop_intvalueW
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'g'
,
'e'
,
'r'
,
'V'
,
'a'
,
'l'
,
'u'
,
'e'
,
0
};
static
const
WCHAR
prop_ipenabledW
[]
=
{
'I'
,
'P'
,
'E'
,
'n'
,
'a'
,
'b'
,
'l'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
prop_lastbootuptimeW
[]
=
{
'L'
,
'a'
,
's'
,
't'
,
'B'
,
'o'
,
'o'
,
't'
,
'U'
,
'p'
,
'T'
,
'i'
,
'm'
,
'e'
,
0
};
static
const
WCHAR
prop_localdatetimeW
[]
=
...
...
@@ -342,6 +347,12 @@ static const struct column col_networkadapter[] =
{
prop_pnpdeviceidW
,
CIM_STRING
},
{
prop_speedW
,
CIM_UINT64
}
};
static
const
struct
column
col_networkadapterconfig
[]
=
{
{
prop_indexW
,
CIM_UINT32
|
COL_FLAG_KEY
},
{
prop_ipenabledW
,
CIM_BOOLEAN
},
{
prop_macaddressW
,
CIM_STRING
|
COL_FLAG_DYNAMIC
}
};
static
const
struct
column
col_os
[]
=
{
{
prop_captionW
,
CIM_STRING
},
...
...
@@ -601,6 +612,12 @@ struct record_networkadapter
const
WCHAR
*
pnpdevice_id
;
UINT64
speed
;
};
struct
record_networkadapterconfig
{
UINT32
index
;
int
ipenabled
;
const
WCHAR
*
mac_address
;
};
struct
record_operatingsystem
{
const
WCHAR
*
caption
;
...
...
@@ -1602,6 +1619,50 @@ static enum fill_status fill_networkadapter( struct table *table, const struct e
return
status
;
}
static
enum
fill_status
fill_networkadapterconfig
(
struct
table
*
table
,
const
struct
expr
*
cond
)
{
struct
record_networkadapterconfig
*
rec
;
IP_ADAPTER_ADDRESSES
*
aa
,
*
buffer
;
UINT
row
=
0
,
offset
=
0
,
count
=
0
;
DWORD
size
=
0
,
ret
;
enum
fill_status
status
=
FILL_STATUS_UNFILTERED
;
ret
=
GetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
NULL
,
&
size
);
if
(
ret
!=
ERROR_BUFFER_OVERFLOW
)
return
FILL_STATUS_FAILED
;
if
(
!
(
buffer
=
heap_alloc
(
size
)))
return
FILL_STATUS_FAILED
;
if
(
GetAdaptersAddresses
(
AF_UNSPEC
,
0
,
NULL
,
buffer
,
&
size
))
{
heap_free
(
buffer
);
return
FILL_STATUS_FAILED
;
}
for
(
aa
=
buffer
;
aa
;
aa
=
aa
->
Next
)
count
++
;
if
(
!
resize_table
(
table
,
count
,
sizeof
(
*
rec
)
))
{
heap_free
(
buffer
);
return
FILL_STATUS_FAILED
;
}
for
(
aa
=
buffer
;
aa
;
aa
=
aa
->
Next
)
{
rec
=
(
struct
record_networkadapterconfig
*
)(
table
->
data
+
offset
);
rec
->
index
=
aa
->
u
.
s
.
IfIndex
;
rec
->
ipenabled
=
-
1
;
rec
->
mac_address
=
get_mac_address
(
aa
->
PhysicalAddress
,
aa
->
PhysicalAddressLength
);
if
(
!
match_row
(
table
,
row
,
cond
,
&
status
))
{
free_row_values
(
table
,
row
);
continue
;
}
offset
+=
sizeof
(
*
rec
);
row
++
;
}
TRACE
(
"created %u rows
\n
"
,
row
);
table
->
num_rows
=
row
;
heap_free
(
buffer
);
return
status
;
}
static
WCHAR
*
get_cmdline
(
DWORD
process_id
)
{
if
(
process_id
==
GetCurrentProcessId
())
return
heap_strdupW
(
GetCommandLineW
()
);
...
...
@@ -2130,6 +2191,8 @@ static struct table builtin_classes[] =
{
class_logicaldiskW
,
SIZEOF
(
col_logicaldisk
),
col_logicaldisk
,
0
,
0
,
NULL
,
fill_logicaldisk
},
{
class_logicaldisk2W
,
SIZEOF
(
col_logicaldisk
),
col_logicaldisk
,
0
,
0
,
NULL
,
fill_logicaldisk
},
{
class_networkadapterW
,
SIZEOF
(
col_networkadapter
),
col_networkadapter
,
0
,
0
,
NULL
,
fill_networkadapter
},
{
class_networkadapterconfigW
,
SIZEOF
(
col_networkadapterconfig
),
col_networkadapterconfig
,
0
,
0
,
NULL
,
fill_networkadapterconfig
},
{
class_osW
,
SIZEOF
(
col_os
),
col_os
,
0
,
0
,
NULL
,
fill_os
},
{
class_paramsW
,
SIZEOF
(
col_param
),
col_param
,
SIZEOF
(
data_param
),
0
,
(
BYTE
*
)
data_param
},
{
class_processW
,
SIZEOF
(
col_process
),
col_process
,
0
,
0
,
NULL
,
fill_process
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment