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
f1fc35de
Commit
f1fc35de
authored
Jan 14, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmpapi: Implement SnmpUtilOidCpy, SnmpUtilOidFree and SnmpUtilVarBindFree.
parent
d62b5c6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
3 deletions
+66
-3
main.c
dlls/snmpapi/main.c
+60
-0
snmpapi.spec
dlls/snmpapi/snmpapi.spec
+3
-3
snmp.h
include/snmp.h
+3
-0
No files found.
dlls/snmpapi/main.c
View file @
f1fc35de
...
...
@@ -24,6 +24,8 @@
#include "windef.h"
#include "winbase.h"
#include "snmp.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
snmpapi
);
...
...
@@ -50,3 +52,61 @@ BOOL WINAPI DllMain(
return
TRUE
;
}
INT
WINAPI
SnmpUtilOidCpy
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
src
)
{
unsigned
int
i
,
size
;
TRACE
(
"(%p, %p)
\n
"
,
dst
,
src
);
size
=
sizeof
(
AsnObjectIdentifier
);
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
{
size
=
src
->
idLength
*
sizeof
(
UINT
);
if
(
!
(
dst
->
ids
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
dst
);
return
SNMPAPI_ERROR
;
}
dst
->
idLength
=
src
->
idLength
;
for
(
i
=
0
;
i
<
dst
->
idLength
;
i
++
)
dst
->
ids
[
i
]
=
src
->
ids
[
i
];
return
SNMPAPI_NOERROR
;
}
return
SNMPAPI_ERROR
;
}
void
WINAPI
SnmpUtilOidFree
(
AsnObjectIdentifier
*
oid
)
{
TRACE
(
"(%p)
\n
"
,
oid
);
HeapFree
(
GetProcessHeap
(),
0
,
oid
->
ids
);
HeapFree
(
GetProcessHeap
(),
0
,
oid
);
}
void
WINAPI
SnmpUtilVarBindFree
(
SnmpVarBind
*
vb
)
{
TRACE
(
"(%p)
\n
"
,
vb
);
switch
(
vb
->
value
.
asnType
)
{
case
ASN_OCTETSTRING
:
case
ASN_BITS
:
case
ASN_SEQUENCE
:
case
ASN_IPADDRESS
:
case
ASN_OPAQUE
:
{
if
(
vb
->
value
.
asnValue
.
string
.
dynamic
)
HeapFree
(
GetProcessHeap
(),
0
,
vb
->
value
.
asnValue
.
string
.
stream
);
break
;
}
case
ASN_OBJECTIDENTIFIER
:
{
HeapFree
(
GetProcessHeap
(),
0
,
vb
->
value
.
asnValue
.
object
.
ids
);
break
;
}
default:
break
;
}
HeapFree
(
GetProcessHeap
(),
0
,
vb
->
name
.
ids
);
HeapFree
(
GetProcessHeap
(),
0
,
vb
);
}
dlls/snmpapi/snmpapi.spec
View file @
f1fc35de
...
...
@@ -25,8 +25,8 @@
@ stub SnmpUtilMemReAlloc
@ stub SnmpUtilOidAppend
@ stub SnmpUtilOidCmp
@ st
ub SnmpUtilOidCpy
@ st
ub SnmpUtilOidFree
@ st
dcall SnmpUtilOidCpy(ptr ptr)
@ st
dcall SnmpUtilOidFree(ptr)
@ stub SnmpUtilOidNCmp
@ stub SnmpUtilOidToA
@ stub SnmpUtilPrintAsnAny
...
...
@@ -34,6 +34,6 @@
@ stub SnmpUtilStrlenW
@ stub SnmpUtilUnicodeToAnsi
@ stub SnmpUtilVarBindCpy
@ st
ub SnmpUtilVarBindFree
@ st
dcall SnmpUtilVarBindFree(ptr)
@ stub SnmpUtilVarBindListCpy
@ stub SnmpUtilVarBindListFree
include/snmp.h
View file @
f1fc35de
...
...
@@ -201,6 +201,9 @@ typedef struct {
#define SNMP_AUTHAPI_INVALID_MSG_TYPE 31
#define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32
#define SNMPAPI_NOERROR TRUE
#define SNMPAPI_ERROR FALSE
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
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