[SNMPAPI]
[reactos.git] / reactos / dll / win32 / snmpapi / main.c
index 0fabba4..ddd4d1f 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
+#define WIN32_NO_STATUS
+
+#include <config.h>
 
 #include <stdio.h>
 #include <stdarg.h>
 
-#include "windef.h"
-#include "winbase.h"
-#include "snmp.h"
+#include <windef.h>
+#include <winbase.h>
+#include <snmp.h>
 
-#include "wine/debug.h"
+#include <wine/debug.h>
 
 WINE_DEFAULT_DEBUG_CHANNEL(snmpapi);
 
@@ -112,6 +114,8 @@ static void asn_any_free(AsnAny *any)
     any->asnType = ASN_NULL;
 }
 
+static ULONGLONG startTime;
+
 /***********************************************************************
  *             DllMain for SNMPAPI
  */
@@ -127,14 +131,28 @@ BOOL WINAPI DllMain(
         return FALSE;  /* prefer native version */
     case DLL_PROCESS_ATTACH:
         DisableThreadLibraryCalls(hInstDLL);
-        break;
-    case DLL_PROCESS_DETACH:
+        startTime = GetTickCount64();
         break;
     }
 
     return TRUE;
 }
 
+/***********************************************************************
+ *      SnmpSvcGetUptime        (SNMPAPI.@)
+ *
+ * BUGS
+ *  This returns the number of centiseconds since the DLL was loaded,
+ *  rather than the number of centiseconds since the SNMP service was
+ *  started, since there isn't yet any SNMP service in Wine.
+ */
+DWORD WINAPI SnmpSvcGetUptime(void)
+{
+    ULONGLONG now = GetTickCount64();
+
+    return (now - startTime) / 10;
+}
+
 /***********************************************************************
  *      SnmpUtilDbgPrint        (SNMPAPI.@)
  *
@@ -145,7 +163,7 @@ BOOL WINAPI DllMain(
  *  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 WINAPIV SnmpUtilDbgPrint(INT loglevel, LPSTR format, ...)
 {
     FIXME("(%d, %s)\n", loglevel, debugstr_a(format));
 }