#2199: th32SnapEnumProcesses in System.Win32.Process prints debugging 
information
to stdout
--------------------------------------+-------------------------------------
    Reporter:  guest                  |        Owner:         
        Type:  bug                    |       Status:  new    
    Priority:  normal                 |    Milestone:         
   Component:  Compiler               |      Version:  6.8.2  
    Severity:  normal                 |   Resolution:         
    Keywords:  th32SnapEnumProcesses  |     Testcase:         
Architecture:  Unknown                |           Os:  Windows
--------------------------------------+-------------------------------------
Comment (by guest):

 Sorry about that formatting, let me try again:

 {{{
 th32SnapEnumProcesses :: Th32SnapHandle -> IO [ProcessEntry32]
 th32SnapEnumProcesses h = allocaBytes 556 $ \pe -> do
     pokeByteOff pe 0 (556 :: DWORD)
     ok <- c_Process32First h pe
     readAndNext ok pe []
     where
         errStr = "th32SnapEnumProcesses: Process32First/Process32Next"
         readAndNext ok pe res
             | not ok    = do
                 err <- getLastError
                 if err == 18
                     then return $ reverse res
                     else failWith errStr err
             | otherwise = do
                 entry <- peekProcessEntry32 pe
                 ok' <- c_Process32Next h pe
                 readAndNext ok' pe (entry:res)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2199#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to