Changeset 4950
- Timestamp:
- Jan 14, 2001, 7:18:26 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/kernel32/HandleManager.cpp ¶
r4949 r4950 1 /* $Id: HandleManager.cpp,v 1.5 8 2001-01-14 17:59:05sandervl Exp $ */1 /* $Id: HandleManager.cpp,v 1.59 2001-01-14 18:18:26 sandervl Exp $ */ 2 2 3 3 /* … … 1855 1855 hObject)); 1856 1856 1857 #if 1 1858 //Workaround for applications that block the PM input queue 1859 //while waiting for a child process to terminate. 1860 //(WaitSingleObject now calls MsgWaitMultipleObjects and 1861 // processes messages while waiting for the process to die) 1862 //(Napster install now doesn't block PM anymore (forcing a reboot)) 1863 1864 HMODULE hUser32 = LoadLibraryA("USER32.DLL"); 1865 1866 BOOL (* WINAPI pfnPeekMessageA)(LPMSG,HWND,UINT,UINT,UINT); 1867 LONG (* WINAPI pfnDispatchMessageA)(const MSG*); 1868 1869 *(FARPROC *)&pfnPeekMessageA = GetProcAddress(hUser32,"PeekMessageA"); 1870 *(FARPROC *)&pfnDispatchMessageA = GetProcAddress(hUser32,"DispatchMessageA"); 1871 1872 TEB *teb = GetThreadTEB(); 1873 1874 if(!teb || !pfnPeekMessageA || !pfnDispatchMessageA) { 1875 dprintf(("ERROR: !teb || !pfnPeekMessageA || !pfnDispatchMessageA")); 1876 DebugInt3(); 1877 return WAIT_FAILED; 1857 if(dwTimeout == INFINITE) { 1858 //Workaround for applications that block the PM input queue 1859 //while waiting for a child process to terminate. 1860 //(WaitSingleObject now calls MsgWaitMultipleObjects and 1861 // processes messages while waiting for the process to die) 1862 //(Napster install now doesn't block PM anymore (forcing a reboot)) 1863 1864 HMODULE hUser32 = LoadLibraryA("USER32.DLL"); 1865 1866 BOOL (* WINAPI pfnPeekMessageA)(LPMSG,HWND,UINT,UINT,UINT); 1867 LONG (* WINAPI pfnDispatchMessageA)(const MSG*); 1868 1869 *(FARPROC *)&pfnPeekMessageA = GetProcAddress(hUser32,"PeekMessageA"); 1870 *(FARPROC *)&pfnDispatchMessageA = GetProcAddress(hUser32,"DispatchMessageA"); 1871 1872 TEB *teb = GetThreadTEB(); 1873 1874 if(!teb || !pfnPeekMessageA || !pfnDispatchMessageA) { 1875 dprintf(("ERROR: !teb || !pfnPeekMessageA || !pfnDispatchMessageA")); 1876 DebugInt3(); 1877 return WAIT_FAILED; 1878 } 1879 1880 //TODO: Ignoring all messages could be dangerous. But processing them, 1881 //while the app doesn't expect any, isn't safe either. 1882 //-> must active check in pmwindow.cpp if this is enabled again! 1883 // teb->o.odin.fIgnoreMsgs = TRUE; 1884 1885 while(TRUE) { 1886 dwResult = O32_MsgWaitForMultipleObjects(1, &hObject, FALSE, 1887 INFINITE, QS_ALLINPUT); 1888 if(dwResult == WAIT_OBJECT_0 + 1) { 1889 MSG msg ; 1890 1891 while (pfnPeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1892 { 1893 if (msg.message == WM_QUIT) return 1; 1894 1895 /* otherwise dispatch it */ 1896 pfnDispatchMessageA(&msg); 1897 1898 } // end of PeekMessage while loop 1899 } 1900 else { 1901 dprintf(("WaitForSingleObject: Process %x terminated", hObject)); 1902 break; 1903 } 1904 } 1905 // teb->o.odin.fIgnoreMsgs = FALSE; 1906 FreeLibrary(hUser32); 1907 return dwResult; 1878 1908 } 1879 1880 //TODO: Ignoring all messages could be dangerous. But processing them, 1881 //while the app doesn't expect any, isn't safe either. 1882 //-> must active check in pmwindow.cpp if this is enabled again! 1883 // teb->o.odin.fIgnoreMsgs = TRUE; 1884 1885 while(TRUE) { 1886 dwResult = O32_MsgWaitForMultipleObjects(1, &hObject, FALSE, 1887 INFINITE, QS_ALLINPUT); 1888 if(dwResult == WAIT_OBJECT_0 + 1) { 1889 MSG msg ; 1890 1891 while (pfnPeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1892 { 1893 if (msg.message == WM_QUIT) return 1; 1894 1895 /* otherwise dispatch it */ 1896 pfnDispatchMessageA(&msg); 1897 1898 } // end of PeekMessage while loop 1899 } 1900 else { 1901 dprintf(("WaitForSingleObject: Process %x terminated", hObject)); 1902 break; 1903 } 1909 else { 1910 // maybe handles from CreateProcess() ... 1911 dwResult = O32_WaitForSingleObject(hObject, dwTimeout); 1912 return (dwResult); 1904 1913 } 1905 // teb->o.odin.fIgnoreMsgs = FALSE;1906 FreeLibrary(hUser32);1907 return dwResult;1908 #else1909 // maybe handles from CreateProcess() ...1910 dwResult = O32_WaitForSingleObject(hObject, dwTimeout);1911 return (dwResult);1912 #endif1913 1914 } 1914 1915
Note:
See TracChangeset
for help on using the changeset viewer.