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
33998963
Commit
33998963
authored
Jan 15, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmpapi: Implement SnmpUtilVarBindList{Cpy,Free}.
parent
71925fe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
2 deletions
+74
-2
main.c
dlls/snmpapi/main.c
+72
-0
snmpapi.spec
dlls/snmpapi/snmpapi.spec
+2
-2
No files found.
dlls/snmpapi/main.c
View file @
33998963
...
...
@@ -54,24 +54,36 @@ BOOL WINAPI DllMain(
return
TRUE
;
}
/***********************************************************************
* SnmpUtilMemAlloc (SNMPAPI.@)
*/
LPVOID
WINAPI
SnmpUtilMemAlloc
(
UINT
nbytes
)
{
TRACE
(
"(%d)
\n
"
,
nbytes
);
return
HeapAlloc
(
GetProcessHeap
(),
0
,
nbytes
);
}
/***********************************************************************
* SnmpUtilMemReAlloc (SNMPAPI.@)
*/
LPVOID
WINAPI
SnmpUtilMemReAlloc
(
LPVOID
mem
,
UINT
nbytes
)
{
TRACE
(
"(%p, %d)
\n
"
,
mem
,
nbytes
);
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
nbytes
);
}
/***********************************************************************
* SnmpUtilMemFree (SNMPAPI.@)
*/
void
WINAPI
SnmpUtilMemFree
(
LPVOID
mem
)
{
TRACE
(
"(%p)
\n
"
,
mem
);
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
/***********************************************************************
* SnmpUtilOidCpy (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilOidCpy
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
src
)
{
unsigned
int
i
,
size
;
...
...
@@ -94,6 +106,9 @@ INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
return
SNMPAPI_ERROR
;
}
/***********************************************************************
* SnmpUtilOidFree (SNMPAPI.@)
*/
void
WINAPI
SnmpUtilOidFree
(
AsnObjectIdentifier
*
oid
)
{
TRACE
(
"(%p)
\n
"
,
oid
);
...
...
@@ -102,6 +117,9 @@ void WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
HeapFree
(
GetProcessHeap
(),
0
,
oid
);
}
/***********************************************************************
* SnmpUtilVarBindCpy (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilVarBindCpy
(
SnmpVarBind
*
dst
,
SnmpVarBind
*
src
)
{
unsigned
int
i
,
size
;
...
...
@@ -171,6 +189,9 @@ error:
return
SNMPAPI_ERROR
;
}
/***********************************************************************
* SnmpUtilVarBindFree (SNMPAPI.@)
*/
void
WINAPI
SnmpUtilVarBindFree
(
SnmpVarBind
*
vb
)
{
TRACE
(
"(%p)
\n
"
,
vb
);
...
...
@@ -198,3 +219,54 @@ void WINAPI SnmpUtilVarBindFree(SnmpVarBind *vb)
HeapFree
(
GetProcessHeap
(),
0
,
vb
->
name
.
ids
);
HeapFree
(
GetProcessHeap
(),
0
,
vb
);
}
/***********************************************************************
* SnmpUtilVarBindListCpy (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilVarBindListCpy
(
SnmpVarBindList
*
dst
,
SnmpVarBindList
*
src
)
{
unsigned
int
i
,
size
;
SnmpVarBind
*
src_entry
,
*
dst_entry
;
TRACE
(
"(%p, %p)
\n
"
,
dst
,
src
);
size
=
src
->
len
*
sizeof
(
SnmpVarBind
*
);
if
(
!
(
dst
->
list
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
dst
);
return
SNMPAPI_ERROR
;
}
src_entry
=
src
->
list
;
dst_entry
=
dst
->
list
;
for
(
i
=
0
;
i
<
src
->
len
;
i
++
)
{
if
(
SnmpUtilVarBindCpy
(
dst_entry
,
src_entry
))
{
src_entry
++
;
dst_entry
++
;
}
else
{
for
(
--
i
;
i
>
0
;
i
--
)
SnmpUtilVarBindFree
(
--
dst_entry
);
HeapFree
(
GetProcessHeap
(),
0
,
dst
->
list
);
return
SNMPAPI_ERROR
;
}
}
dst
->
len
=
src
->
len
;
return
SNMPAPI_NOERROR
;
}
/***********************************************************************
* SnmpUtilVarBindListFree (SNMPAPI.@)
*/
void
WINAPI
SnmpUtilVarBindListFree
(
SnmpVarBindList
*
vb
)
{
unsigned
int
i
;
SnmpVarBind
*
entry
;
TRACE
(
"(%p)
\n
"
,
vb
);
entry
=
vb
->
list
;
for
(
i
=
0
;
i
<
vb
->
len
;
i
++
)
SnmpUtilVarBindFree
(
entry
++
);
HeapFree
(
GetProcessHeap
(),
0
,
vb
->
list
);
}
dlls/snmpapi/snmpapi.spec
View file @
33998963
...
...
@@ -41,5 +41,5 @@
@ stub SnmpUtilUnicodeToAnsi
@ stdcall SnmpUtilVarBindCpy(ptr ptr)
@ stdcall SnmpUtilVarBindFree(ptr)
@ st
ub SnmpUtilVarBindListCpy
@ st
ub SnmpUtilVarBindListFree
@ st
dcall SnmpUtilVarBindListCpy(ptr ptr)
@ st
dcall SnmpUtilVarBindListFree(ptr)
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