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
bca85b3d
Commit
bca85b3d
authored
Jan 22, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
snmpapi: Implement SnmpUtilOctets{Cmp,Cpy,Free,NCmp}.
parent
1928c7c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
4 deletions
+78
-4
main.c
dlls/snmpapi/main.c
+74
-0
snmpapi.spec
dlls/snmpapi/snmpapi.spec
+4
-4
No files found.
dlls/snmpapi/main.c
View file @
bca85b3d
...
...
@@ -179,6 +179,80 @@ void WINAPI SnmpUtilAsnAnyFree(AsnAny *any)
}
/***********************************************************************
* SnmpUtilOctetsCpy (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilOctetsCpy
(
AsnOctetString
*
dst
,
AsnOctetString
*
src
)
{
TRACE
(
"(%p, %p)
\n
"
,
dst
,
src
);
if
(
!
dst
)
return
SNMPAPI_ERROR
;
if
(
!
src
)
{
dst
->
dynamic
=
FALSE
;
dst
->
length
=
0
;
dst
->
stream
=
NULL
;
return
SNMPAPI_NOERROR
;
}
if
((
dst
->
stream
=
HeapAlloc
(
GetProcessHeap
(),
0
,
src
->
length
)))
{
unsigned
int
i
;
dst
->
dynamic
=
TRUE
;
dst
->
length
=
src
->
length
;
for
(
i
=
0
;
i
<
dst
->
length
;
i
++
)
dst
->
stream
[
i
]
=
src
->
stream
[
i
];
return
SNMPAPI_NOERROR
;
}
return
SNMPAPI_ERROR
;
}
/***********************************************************************
* SnmpUtilOctetsFree (SNMPAPI.@)
*/
void
WINAPI
SnmpUtilOctetsFree
(
AsnOctetString
*
octets
)
{
TRACE
(
"(%p)
\n
"
,
octets
);
if
(
octets
)
{
octets
->
length
=
0
;
if
(
octets
->
dynamic
)
HeapFree
(
GetProcessHeap
(),
0
,
octets
->
stream
);
octets
->
stream
=
NULL
;
octets
->
dynamic
=
FALSE
;
}
}
/***********************************************************************
* SnmpUtilOctetsNCmp (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilOctetsNCmp
(
AsnOctetString
*
octets1
,
AsnOctetString
*
octets2
,
UINT
count
)
{
INT
ret
;
unsigned
int
i
;
TRACE
(
"(%p, %p, %d)
\n
"
,
octets1
,
octets2
,
count
);
if
(
!
octets1
||
!
octets2
)
return
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
if
((
ret
=
octets1
->
stream
[
i
]
-
octets2
->
stream
[
i
]))
return
ret
;
return
0
;
}
/***********************************************************************
* SnmpUtilOctetsCmp (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilOctetsCmp
(
AsnOctetString
*
octets1
,
AsnOctetString
*
octets2
)
{
TRACE
(
"(%p, %p)
\n
"
,
octets1
,
octets2
);
if
(
octets1
->
length
<
octets2
->
length
)
return
-
1
;
if
(
octets1
->
length
>
octets2
->
length
)
return
1
;
return
SnmpUtilOctetsNCmp
(
octets1
,
octets2
,
octets1
->
length
);
}
/***********************************************************************
* SnmpUtilOidCpy (SNMPAPI.@)
*/
INT
WINAPI
SnmpUtilOidCpy
(
AsnObjectIdentifier
*
dst
,
AsnObjectIdentifier
*
src
)
...
...
dlls/snmpapi/snmpapi.spec
View file @
bca85b3d
...
...
@@ -25,10 +25,10 @@
@ stdcall SnmpUtilMemAlloc(long)
@ stdcall SnmpUtilMemFree(ptr)
@ stdcall SnmpUtilMemReAlloc(ptr long)
@ st
ub SnmpUtilOctetsCmp
@ st
ub SnmpUtilOctetsCpy
@ st
ub SnmpUtilOctetsFree
@ st
ub SnmpUtilOctetsNCmp
@ st
dcall SnmpUtilOctetsCmp(ptr ptr)
@ st
dcall SnmpUtilOctetsCpy(ptr ptr)
@ st
dcall SnmpUtilOctetsFree(ptr)
@ st
dcall SnmpUtilOctetsNCmp(ptr ptr long)
@ stub SnmpUtilOidAppend
@ stub SnmpUtilOidCmp
@ stdcall SnmpUtilOidCpy(ptr 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