From b7f753a826e6c35086e16867b40918d293e783a5 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 7 Dec 2009 12:02:07 -0800 Subject: [PATCH] snmpapi: Add stub for SnmpSvcGetUptime. --- dlls/snmpapi/main.c | 18 ++++++++++++++++++ dlls/snmpapi/snmpapi.spec | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/snmpapi/main.c b/dlls/snmpapi/main.c index 9e14a194876..1c4d1fa36cd 100644 --- a/dlls/snmpapi/main.c +++ b/dlls/snmpapi/main.c @@ -112,6 +112,8 @@ static void asn_any_free(AsnAny *any) any->asnType = ASN_NULL; } +static ULONGLONG startTime; + /*********************************************************************** * DllMain for SNMPAPI */ @@ -127,6 +129,7 @@ BOOL WINAPI DllMain( return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstDLL); + startTime = GetTickCount64(); break; case DLL_PROCESS_DETACH: break; @@ -135,6 +138,21 @@ BOOL WINAPI DllMain( 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.@) * diff --git a/dlls/snmpapi/snmpapi.spec b/dlls/snmpapi/snmpapi.spec index 385ca8ac7a4..208231ecfbe 100644 --- a/dlls/snmpapi/snmpapi.spec +++ b/dlls/snmpapi/snmpapi.spec @@ -11,7 +11,7 @@ @ stub SnmpSvcGenerateTrap @ stub SnmpSvcGenerateWarmStartTrap @ stub SnmpSvcGetEnterpriseOID -@ stub SnmpSvcGetUptime +@ stdcall SnmpSvcGetUptime() @ stub SnmpSvcInitUptime @ stub SnmpSvcReleaseMessage @ stub SnmpSvcReportEvent