snmpapi: SnmpUtilDbgPrint() is a vararg and not an stdcall function.
Francois Gouget
fgouget at free.fr
Wed Jan 24 08:39:26 CST 2007
This fixes a winapi_check warning.
---
dlls/snmpapi/main.c | 9 ++++++++-
dlls/snmpapi/snmpapi.spec | 2 +-
include/snmp.h | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/snmpapi/main.c b/dlls/snmpapi/main.c
index 6a8f955..420fc91 100644
--- a/dlls/snmpapi/main.c
+++ b/dlls/snmpapi/main.c
@@ -136,8 +136,15 @@ BOOL WINAPI DllMain(
/***********************************************************************
* SnmpUtilDbgPrint (SNMPAPI.@)
+ *
+ * NOTES
+ * The Microsoft headers claim this function uses the stdcall calling
+ * convention. But stdcall functions cannot take a variable number of
+ * arguments so this does not make sense. The stdcall specification is
+ * probably ignored by Microsoft's compiler in this case. So declare it
+ * correctly in Wine so it works with all compilers.
*/
-void WINAPI SnmpUtilDbgPrint(INT loglevel, LPSTR format, ...)
+void SnmpUtilDbgPrint(INT loglevel, LPSTR format, ...)
{
FIXME("(%d, %s)\n", loglevel, debugstr_a(format));
}
diff --git a/dlls/snmpapi/snmpapi.spec b/dlls/snmpapi/snmpapi.spec
index 2ada750..385ca8a 100644
--- a/dlls/snmpapi/snmpapi.spec
+++ b/dlls/snmpapi/snmpapi.spec
@@ -20,7 +20,7 @@
@ stub SnmpUtilAnsiToUnicode
@ stdcall SnmpUtilAsnAnyCpy(ptr ptr)
@ stdcall SnmpUtilAsnAnyFree(ptr)
-@ stdcall SnmpUtilDbgPrint(long str)
+@ varargs SnmpUtilDbgPrint(long str)
@ stdcall SnmpUtilIdsToA(ptr long)
@ stdcall SnmpUtilMemAlloc(long)
@ stdcall SnmpUtilMemFree(ptr)
diff --git a/include/snmp.h b/include/snmp.h
index aaece6c..e5756b9 100644
--- a/include/snmp.h
+++ b/include/snmp.h
@@ -289,7 +289,7 @@ DWORD WINAPI SnmpSvcGetUptime(void);
void WINAPI SnmpSvcSetLogLevel(int nLogLevel);
void WINAPI SnmpSvcSetLogType(int nLogType);
-void WINAPI SnmpUtilDbgPrint(int nLogLevel, LPSTR szFormat, ...);
+void SnmpUtilDbgPrint(int nLogLevel, LPSTR szFormat, ...);
#ifdef __cplusplus
}
--
1.4.4.3
More information about the wine-patches
mailing list