1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /*
- * category: [misc]
- * apply status:
- * edit status:
- * build status:
- * description:
- */
- #ifndef __OSUTIL_H__
- #define __OSUTIL_H__
- #pragma once
- #include "config.h"
- typedef void* ostuile_void_ptr;
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define MAX_ALIVE_PROCESS_COUNT 100
- #define ALIVE_PROCESS_PATH_LEN 512
- typedef struct t_process_info
- {
- int pid;
- char name[64];
- char path[ALIVE_PROCESS_PATH_LEN]; //or cmd
- } alive_process_info;
- typedef struct toolkit_utsname_s
- {
- char sysname[256];
- char release[256];
- char version[256];
- char machine[256];
- /* This struct does not contain the nodename and domainname fields present in
- the utsname type. domainname is a GNU extension. Both fields are referred
- to as meaningless in the docs. */
- }tk_utsname_t;
- typedef struct toolkit_systime_s {
- unsigned short year;
- unsigned short month;
- unsigned short dayofweek;
- unsigned short day;
- unsigned short hour;
- unsigned short minute;
- unsigned short second;
- unsigned short milli_seconds;
- } tk_systime_t;
- // non-zero: unique
- // zero: has clone
- TOOLKIT_API int osutil_detect_unique_app(char **pNames, int nNum, int* alive, alive_process_info* alive_process_arr);
- TOOLKIT_API int osutil_restart_system();
- TOOLKIT_API int osutil_shutdown_system();
- //force: which is only available at UOS, non-zero meaning kill -9 otherwise -15
- TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size, int force);
- TOOLKIT_API int osutil_uname(tk_utsname_t* buffer);
- TOOLKIT_API int osutil_system_boot_time(tk_systime_t* ptr_boot_time);
- /*
- * -1:failed
- * 0:no
- * 1:yes
- */
- TOOLKIT_API int osutil_is32r64_platform();
- TOOLKIT_API ostuile_void_ptr osutil_sure_redirect_32sys_in_wow64();
- TOOLKIT_API void osutil_reset_redirect_32sys_in_wow64(ostuile_void_ptr* value);
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //__OSUTIL_H__
|