Init: Migrate SimpleRemoter (Since v1.3.1) to Gitea

This commit is contained in:
yuanyuanxiang
2026-04-19 19:55:01 +02:00
commit 5a325a202b
744 changed files with 235562 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
#ifndef SERVER_SERVICE_WRAPPER_H
#define SERVER_SERVICE_WRAPPER_H
#include <windows.h>
#include "UIBranding.h"
#ifdef __cplusplus
extern "C" {
#endif
// 服务配置:服务端使用不同的服务名
// Debug 版本使用不同的服务名,便于调试
// 服务名和显示名均可通过 UIBranding.h 定制
#ifdef _DEBUG
#define SERVER_SERVICE_NAME BRAND_SERVICE_NAME "_Debug"
#define SERVER_SERVICE_DISPLAY BRAND_SERVICE_DISPLAY " (Debug)"
#define SERVER_SERVICE_DESC "Provides remote desktop control server functionality."
#else
#define SERVER_SERVICE_NAME BRAND_SERVICE_NAME
#define SERVER_SERVICE_DISPLAY BRAND_SERVICE_DISPLAY
#define SERVER_SERVICE_DESC "Provides remote desktop control server functionality."
#endif
/*
# 停止服务
net stop YamaControlService
# 查看状态(应该显示 STOPPED
sc query YamaControlService
# 启动服务
net start YamaControlService
# 再次查看状态(应该显示 RUNNING
sc query YamaControlService
*/
// 检查服务状态
// 参数:
// registered - 输出参数,服务是否已注册
// running - 输出参数,服务是否正在运行
// exePath - 输出参数服务可执行文件路径可为NULL
// exePathSize - exePath缓冲区大小
// 返回: 成功返回TRUE
BOOL ServerService_CheckStatus(BOOL* registered, BOOL* running,
char* exePath, size_t exePathSize);
// 简单启动服务
// 返回: ERROR_SUCCESS 或错误码
int ServerService_StartSimple(void);
// 运行服务(作为服务主入口)
// 返回: ERROR_SUCCESS 或错误码
int ServerService_Run(void);
// 停止服务
// 返回: ERROR_SUCCESS 或错误码
int ServerService_Stop(void);
// 安装服务
BOOL ServerService_Install(void);
// 卸载服务
BOOL ServerService_Uninstall(void);
// 服务工作线程
DWORD WINAPI ServerService_WorkerThread(LPVOID lpParam);
#ifdef __cplusplus
}
#endif
#endif /* SERVER_SERVICE_WRAPPER_H */