Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
50f4bd16
Commit
50f4bd16
authored
May 20, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetmib1: Improve SnmpExtensionQuery stub.
parent
46f7f76b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
main.c
dlls/inetmib1/main.c
+20
-2
main.c
dlls/inetmib1/tests/main.c
+2
-8
No files found.
dlls/inetmib1/main.c
View file @
50f4bd16
...
...
@@ -47,6 +47,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return
TRUE
;
}
static
UINT
mib2
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
};
static
UINT
mib2System
[]
=
{
1
,
3
,
6
,
1
,
2
,
1
,
1
};
BOOL
WINAPI
SnmpExtensionInit
(
DWORD
dwUptimeReference
,
...
...
@@ -65,7 +66,24 @@ BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
BOOL
WINAPI
SnmpExtensionQuery
(
BYTE
bPduType
,
SnmpVarBindList
*
pVarBindList
,
AsnInteger32
*
pErrorStatus
,
AsnInteger32
*
pErrorIndex
)
{
FIXME
(
"(0x%02x, %p, %p, %p): stub
\n
"
,
bPduType
,
pVarBindList
,
AsnObjectIdentifier
mib2oid
=
DEFINE_OID
(
mib2
);
AsnInteger32
error
=
SNMP_ERRORSTATUS_NOERROR
,
errorIndex
=
0
;
UINT
i
;
TRACE
(
"(0x%02x, %p, %p, %p)
\n
"
,
bPduType
,
pVarBindList
,
pErrorStatus
,
pErrorIndex
);
return
FALSE
;
for
(
i
=
0
;
!
error
&&
i
<
pVarBindList
->
len
;
i
++
)
{
/* Ignore any OIDs not in MIB2 */
if
(
!
SnmpUtilOidNCmp
(
&
pVarBindList
->
list
[
i
].
name
,
&
mib2oid
,
mib2oid
.
idLength
))
{
FIXME
(
"%s: stub
\n
"
,
SnmpUtilOidToA
(
&
pVarBindList
->
list
[
i
].
name
));
error
=
SNMP_ERRORSTATUS_NOSUCHNAME
;
}
}
*
pErrorStatus
=
error
;
*
pErrorIndex
=
errorIndex
;
return
TRUE
;
}
dlls/inetmib1/tests/main.c
View file @
50f4bd16
...
...
@@ -81,12 +81,10 @@ static void testQuery(void)
error
=
0xdeadbeef
;
index
=
0xdeadbeef
;
ret
=
pQuery
(
SNMP_PDU_GET
,
&
list
,
&
error
,
&
index
);
todo_wine
{
ok
(
ret
,
"SnmpExtensionQuery failed: %d
\n
"
,
GetLastError
());
ok
(
error
==
SNMP_ERRORSTATUS_NOERROR
,
"expected SNMP_ERRORSTATUS_NOERROR, got %d
\n
"
,
error
);
ok
(
index
==
0
,
"expected index 0, got %d
\n
"
,
index
);
}
/* Oddly enough, this "succeeds," even though the OID is clearly
* unsupported.
...
...
@@ -100,12 +98,10 @@ static void testQuery(void)
error
=
0xdeadbeef
;
index
=
0xdeadbeef
;
ret
=
pQuery
(
SNMP_PDU_GET
,
&
list
,
&
error
,
&
index
);
todo_wine
{
ok
(
ret
,
"SnmpExtensionQuery failed: %d
\n
"
,
GetLastError
());
ok
(
error
==
SNMP_ERRORSTATUS_NOERROR
,
"expected SNMP_ERRORSTATUS_NOERROR, got %d
\n
"
,
error
);
ok
(
index
==
0
,
"expected index 0, got %d
\n
"
,
index
);
}
/* The OID isn't changed either: */
ok
(
!
strcmp
(
"1.2.3.4"
,
SnmpUtilOidToA
(
&
vars
[
0
].
name
)),
"expected 1.2.3.4, got %s
\n
"
,
SnmpUtilOidToA
(
&
vars
[
0
].
name
));
...
...
@@ -117,13 +113,12 @@ static void testQuery(void)
error
=
0xdeadbeef
;
index
=
0xdeadbeef
;
ret
=
pQuery
(
SNMP_PDU_GET
,
&
list
,
&
error
,
&
index
);
todo_wine
{
ok
(
ret
,
"SnmpExtensionQuery failed: %d
\n
"
,
GetLastError
());
ok
(
error
==
SNMP_ERRORSTATUS_NOSUCHNAME
,
"expected SNMP_ERRORSTATUS_NOSUCHNAME, got %d
\n
"
,
error
);
/* The index is 1-based rather than 0-based */
todo_wine
ok
(
index
==
1
,
"expected index 1, got %d
\n
"
,
index
);
}
/* Even though SnmpExtensionInit says this DLL supports the MIB2 system
* variables, the first variable it returns a value for is the first
...
...
@@ -137,12 +132,11 @@ static void testQuery(void)
list
.
list
=
vars2
;
moreData
=
TRUE
;
ret
=
pQuery
(
SNMP_PDU_GETNEXT
,
&
list
,
&
error
,
&
index
);
todo_wine
{
ok
(
ret
,
"SnmpExtensionQuery failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
error
==
SNMP_ERRORSTATUS_NOERROR
,
"expected SNMP_ERRORSTATUS_NOERROR, got %d
\n
"
,
error
);
ok
(
index
==
0
,
"expected index 0, got %d
\n
"
,
index
);
}
vars
[
0
].
name
.
idLength
=
sizeof
(
mib2If
)
/
sizeof
(
mib2If
[
0
]);
vars
[
0
].
name
.
ids
=
mib2If
;
todo_wine
...
...
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