| 386 | |
| 387 | |
| 388 | BOOL CanEndServer(HWND hWnd) |
| 389 | { |
| 390 | /****************************************************************************** |
| 391 | * |
| 392 | * C a n E n d S e r v e r |
| 393 | * |
| 394 | ****************************************************************************** |
| 395 | * |
| 396 | * Input: hWnd - Handle to main application window. |
| 397 | * |
| 398 | * Return: FALSE if user does not want to end the server session |
| 399 | * TRUE if user confirmed on server session termination |
| 400 | * |
| 401 | * Description: This function displays a message mox and queries the user if |
| 402 | * the server can be shutdown. |
| 403 | *****************************************************************************/ |
| 404 | ULONG usNumAtt, usNumDbs, usNumSvc; |
| 405 | SRVR_enum_attachments(usNumAtt, usNumDbs, usNumSvc); |
| 406 | |
| 407 | if (!usNumAtt && !usNumSvc) // IF 0 CONNECTIONS, JUST SHUTDOWN |
| 408 | return TRUE; |
| 409 | |
| 410 | char szMsgString1[BUFFER_MEDIUM], szMsgString2[BUFFER_MEDIUM]; |
| 411 | if (usNumAtt) |
| 412 | { |
| 413 | LoadString(hInstance, IDS_QUIT1, szMsgString1, sizeof(szMsgString1)); |
| 414 | sprintf(szMsgString2, szMsgString1, usNumAtt); |
| 415 | } |
| 416 | else |
| 417 | { |
| 418 | LoadString(hInstance, IDS_QUIT2, szMsgString1, sizeof(szMsgString1)); |
| 419 | sprintf(szMsgString2, szMsgString1, usNumSvc); |
| 420 | } |
| 421 | |
| 422 | return (MessageBox(hWnd, szMsgString2, APP_LABEL, MB_ICONQUESTION | MB_OKCANCEL) == IDOK); |
| 423 | } |
| 424 | |
| 425 | |
| 426 | static int fb_shutdown_cb(const int, const int, void*) |
no test coverage detected