The fixed timeout of 19 seconds was too short. Should be set to the
value of HardDeadtimeout as set by cm_conn.c. The failure to specify
an adequate timeout value prevented successful Hibernation and Standby
mode access when network connectivity was not available.
#include "afsd.h"
#include "afsd_init.h"
#include "smb.h"
+#include "cm_conn.h"
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
DWORD dwRet = 0;
BOOL bRet = FALSE;
- // Notify thread of power event, and wait 19 seconds
+ // Notify thread of power event, and wait for the HardDead timeout period
dwRet = SignalObjectAndWait(
gThreadInfo.hEventPowerEvent, // object to signal
gThreadInfo.hEventResumeMain, // object to watch
- 19*1000, // timeout (ms)
+ HardDeadtimeout*1000, // timeout (ms)
FALSE // alertable
);