mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
45
modules/rostests/tests/alive/alive.c
Normal file
45
modules/rostests/tests/alive/alive.c
Normal file
|
@ -0,0 +1,45 @@
|
|||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
HANDLE StandardOutput = INVALID_HANDLE_VALUE;
|
||||
CHAR Message [80];
|
||||
DWORD CharactersToWrite = 0;
|
||||
DWORD WrittenCharacters = 0;
|
||||
INT d = 0, h = 0, m = 0, s = 0;
|
||||
|
||||
int
|
||||
main (int argc, char * argv [])
|
||||
{
|
||||
StandardOutput = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||
if (INVALID_HANDLE_VALUE == StandardOutput)
|
||||
{
|
||||
return (EXIT_FAILURE);
|
||||
}
|
||||
while (TRUE)
|
||||
{
|
||||
/* Prepare the message and update it */
|
||||
CharactersToWrite =
|
||||
wsprintf (
|
||||
Message,
|
||||
"Alive for %dd %dh %d' %d\" \r",
|
||||
d, h, m, s
|
||||
);
|
||||
WriteConsole (
|
||||
StandardOutput,
|
||||
Message,
|
||||
CharactersToWrite,
|
||||
& WrittenCharacters,
|
||||
NULL
|
||||
);
|
||||
/* suspend the execution for 1s */
|
||||
Sleep (1000);
|
||||
/* increment seconds */
|
||||
++ s;
|
||||
if (60 == s) { s = 0; ++ m; }
|
||||
if (60 == m) { m = 0; ++ h; }
|
||||
if (24 == h) { h = 0; ++ d; }
|
||||
}
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue