Issue 119947 - [Windows 8 certification]Windows App Certification Kit - Test for "Section 4 Apps must adhere to system restart manager messages" is failed
Summary: [Windows 8 certification]Windows App Certification Kit - Test for "Section 4 ...
Status: CONFIRMED
Alias: None
Product: General
Classification: Code
Component: ui (show other issues)
Version: 3.4.0
Hardware: PC Windows 7
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 05:22 UTC by DaLi Liu
Modified: 2017-05-20 11:53 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Raw log for Main() and WM_QUERYENDSESSION event (10.74 KB, text/plain)
2012-07-09 06:19 UTC, yuanlin
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description DaLi Liu 2012-06-12 05:22:44 UTC
Test the package Apache_OpenOffice_incubating_3.4.0_Win_x86_install_en-US.exe  with Windows App Certification Kit on windows 8 release preview, get this warning result, it will be passed in order to pass the Windows 8 certification program.
----------------------------------------------------------------------
Related links:
Windows 8 Preview ISO image
http://windows.microsoft.com/en-US/windows-8/iso
Windows App Certification Kit
http://msdn.microsoft.com/en-us/windows/desktop/hh852363
Certification requirements for Windows 8 desktop apps
http://msdn.microsoft.com/library/windows/desktop/hh749939
----------------------------------------------------------------------
The result.
Adhere to system restart manager messages

WARNING
    Don't block reboot

    Warning: The don’t block reboot test detected the following errors:
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.bin failed to shutdown.
        Executable C:\program files\openoffice.org 3\program\soffice.exe failed to shutdown.
    Some apps display EULAs, auto update, registration forms, and, or other prompts for user interaction. If your app does this, it could be reported as non-compliant with the restart requirement. If any of these files are reported for this reason, disable or dismiss all such modules and restart testing on a clean OS.
    Impact if not fixed: If an app doesn’t shut down gracefully, customers can lose data when the OS forces the shutdown. Not responding to system shutdown requests also slows the shutdown/reboot process, which makes the entire system appear slower.
    How to fix: The app must respond to system shutdown and end session messages as quickly as possible. See link below for more information:
    Application Shutdown 
http://go.microsoft.com/fwlink/?LinkId=247362
----------------------------------------------------------------------
Please see the wiki page for full test result.
http://wiki.services.openoffice.org/wiki/Documentation/Windows_App_Certification_Kit_-_Test_Results_for_Apache_OpenOffice_3.4
Comment 1 DaLi Liu 2012-06-28 07:58:45 UTC
It seems that we handle these system restart manager messages in a right way.
Anyone can have a double check on this?
Here is the codes in main\vcl\win\source\window\salframe.cxx.
......
LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef )
{
......
 case WM_QUERYENDSESSION:
			if( !bInQueryEnd )
			{
				// handle queryendsession only once
				bInQueryEnd = TRUE;
				nRet = !ImplHandleShutDownMsg( hWnd );
				rDef = FALSE;

				// Issue #16314#: ImplHandleShutDownMsg causes a PostMessage in case of allowing shutdown.
				// This posted message was never processed and cause Windows XP to hang after log off
				// if there are multiple sessions and the current session wasn't the first one started.
				// So if shutdown is allowed we assume that a post message was done and retrieve all
				// messages in the message queue and dispatch them before we return control to the system.

				if ( nRet )
				{
					MSG	msg;

					while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
					{
						DispatchMessage( &msg );
					}
				}
			}
			else
			{
				ImplSalYieldMutexAcquireWithWait();
				ImplSalYieldMutexRelease();
				rDef = TRUE;
			}
            break;

		case WM_ENDSESSION:
			if( !wParam )
				bInQueryEnd = FALSE; // no shutdown: allow query again
			nRet = FALSE;
			rDef = FALSE;
			break;
......
Comment 2 yuanlin 2012-07-09 06:19:06 UTC
Created attachment 78596 [details]
Raw log for Main() and WM_QUERYENDSESSION event

I did a customized build based on AOO3.5 0706 version and add some logs for ImplSVMain(),  Desktop::Main() functions and for WM_QUERYENDSESSION,WM_ENDSESSION,WM_CLOSE Windows event. And tested it with Windows App Cert Kit on Windows 7 32bit platform.

So we can know the from the logs that the App Cert Kit will test 7 AOO application registered to Windows after installation. The App Cert Kit will launch each applications with no parameters and close it after a while. 
And there are 3 kinds of test results
1. soffice.exe
Can pass.
2. simpress.exe, sbase.exe
The two applications will popup a wizard dialog which will block Windows platform to shutdown. May need try to cancel the wizard dialog on this situation.
3. scalc.exe, sdraw.exe, swriter.exe, smath.exe
The test failed. AOO can return correct result in the WM_QUERYENDSESSION,WM_ENDSESSION,WM_CLOSE event handler. But the log indicate AOO blocked in Desktop:DestroyApplicationServiceManager() function. Not sure
the root cause. In normal debug envirnoment. The soffice.bin can behavior correctly and will not block at that place. 
If add a exit() in WM_ENDSESSION event handler. The test can pass.
Comment 3 Rob Weir 2013-01-09 13:36:15 UTC
confirmed as new task
Comment 4 Oliver-Rainer Wittmann 2013-06-14 13:11:22 UTC
no show stopper as Windows 8 certification is not in our scope for AOO 4.0