mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +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
|
@ -0,0 +1,9 @@
|
|||
#add_definitions(-DLINUX_OUTPUT)
|
||||
|
||||
add_executable(uptime uptime.c uptime.rc)
|
||||
set_module_type(uptime win32cui)
|
||||
add_importlibs(uptime msvcrt kernel32)
|
||||
if(MSVC)
|
||||
add_importlibs(uptime ntdll)
|
||||
endif()
|
||||
add_cd_file(TARGET uptime DESTINATION reactos/system32 FOR all)
|
34
modules/rosapps/applications/cmdutils/uptime/uptime.c
Normal file
34
modules/rosapps/applications/cmdutils/uptime/uptime.c
Normal file
|
@ -0,0 +1,34 @@
|
|||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
SYSTEMTIME SystemTime;
|
||||
LARGE_INTEGER liCount, liFreq;
|
||||
|
||||
GetLocalTime(&SystemTime);
|
||||
|
||||
if (QueryPerformanceCounter(&liCount) &&
|
||||
QueryPerformanceFrequency(&liFreq))
|
||||
{
|
||||
LONGLONG TotalSecs = liCount.QuadPart / liFreq.QuadPart;
|
||||
LONGLONG Days = (TotalSecs / 86400);
|
||||
LONGLONG Hours = ((TotalSecs % 86400) / 3600);
|
||||
LONGLONG Mins = ((TotalSecs % 86400) % 3600) / 60;
|
||||
LONGLONG Secs = ((TotalSecs % 86400) % 3600) % 60;
|
||||
|
||||
#ifdef LINUX_OUTPUT
|
||||
UNREFERENCED_PARAMETER(Secs);
|
||||
_tprintf(_T(" %.2u:%.2u "), SystemTime.wHour, SystemTime.wMinute);
|
||||
_tprintf(_T("up %I64u days, %I64u:%I64u\n"), Days, Hours, Mins); /*%.2I64u secs*/
|
||||
#else
|
||||
_tprintf(_T("System Up Time:\t\t%I64u days, %I64u Hours, %I64u Minutes, %.2I64u Seconds\n"),
|
||||
Days, Hours, Mins, Secs);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
4
modules/rosapps/applications/cmdutils/uptime/uptime.rc
Normal file
4
modules/rosapps/applications/cmdutils/uptime/uptime.rc
Normal file
|
@ -0,0 +1,4 @@
|
|||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS uptime\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "uptime\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "uptime.exe\0"
|
||||
#include <reactos/version.rc>
|
Loading…
Add table
Add a link
Reference in a new issue