mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 21:47:45 +00:00
windows-power-mgmt-20080105
LICENSE MIT Log more power mgmt events. Do not permit a smb reinitialization when in a suspended state Periodically check to see if the LAN adapter is -1. If so, try to reinitialize the smb stack.
This commit is contained in:
parent
d27e82c8e2
commit
6887c0e5b2
@ -250,6 +250,11 @@ afsd_ServiceControlHandlerEx(
|
||||
{
|
||||
case SERVICE_CONTROL_SHUTDOWN:
|
||||
case SERVICE_CONTROL_STOP:
|
||||
if (ctrlCode == SERVICE_CONTROL_SHUTDOWN)
|
||||
afsi_log("SERVICE_CONTROL_SHUTDOWN");
|
||||
else
|
||||
afsi_log("SERVICE_CONTROL_STOP");
|
||||
|
||||
ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
|
||||
ServiceStatus.dwWin32ExitCode = NO_ERROR;
|
||||
ServiceStatus.dwCheckPoint = 1;
|
||||
|
@ -8328,8 +8328,9 @@ void smb_LanAdapterChange(void) {
|
||||
char NetbiosName[MAX_NB_NAME_LENGTH] = "";
|
||||
int change = 0;
|
||||
|
||||
if (SUCCEEDED(lana_GetUncServerNameEx(NetbiosName, &lanaNum, &bGateway,
|
||||
LANA_NETBIOS_NAME_FULL))) {
|
||||
if (!powerStateSuspended &&
|
||||
SUCCEEDED(lana_GetUncServerNameEx(NetbiosName, &lanaNum, &bGateway,
|
||||
LANA_NETBIOS_NAME_FULL))) {
|
||||
if (smb_LANadapter != lanaNum ||
|
||||
isGateway != bGateway ||
|
||||
strcmp(cm_NetbiosName, NetbiosName))
|
||||
@ -8506,7 +8507,7 @@ int smb_NetbiosInit(void)
|
||||
/* we're done with the NCB now */
|
||||
FreeNCB(ncbp);
|
||||
|
||||
return (lana_list.length > 0 ? 1 : 0);
|
||||
return ((lana_list.length > 0 && smb_LANadapter != -1) ? 1 : 0);
|
||||
}
|
||||
|
||||
void smb_StartListeners()
|
||||
@ -8537,9 +8538,13 @@ void smb_StartListeners()
|
||||
|
||||
void smb_RestartListeners()
|
||||
{
|
||||
if (!powerStateSuspended && smb_ListenerState == SMB_LISTENER_STOPPED) {
|
||||
if (smb_NetbiosInit())
|
||||
smb_StartListeners();
|
||||
if (!powerStateSuspended) {
|
||||
if (smb_ListenerState == SMB_LISTENER_STOPPED) {
|
||||
if (smb_NetbiosInit())
|
||||
smb_StartListeners();
|
||||
}
|
||||
if (smb_LANadapter == -1)
|
||||
smb_LanAdapterChange();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user